Salesforce interview questions for admins and developers
Salesforce interview questions cover two overlapping jobs. Admin questions test the data model (objects, lookup and master-detail relationships), the security model (profiles, permission sets, org-wide defaults and sharing) and automation with Flow. Developer questions add Apex, bulk-safe triggers, governor limits, SOQL and SOSL, asynchronous processing, tests and Lightning Web Components. In both, interviewers look for the declarative-first habit: knowing when configuration is enough and when code is justified.
By Evin JohnPublished 9 min read
How Salesforce interviews are usually run
Admin interviews tend to be conversational with scenario questions: a sales manager cannot see a team member's opportunities, a field must be required only for one record type, a process has to notify finance when a deal closes. Some include a short hands-on task in a sandbox. Developer interviews add code review of an Apex trigger, a design question on integrating with an outside system, and questions on deployment and testing. Consultant and architect roles lean on requirements gathering and trade-offs between configuration, code and installed apps. Certifications such as Administrator or Platform Developer help get the interview, but questions go past the exam topics into how you handled real orgs.
Data model fundamentals
| Question | What it tests | What a strong answer shows |
|---|---|---|
| Standard versus custom objects? | Basics | Standard objects such as Account, Contact, Opportunity and Case come with the platform. Custom objects are ones you create; their API names end in __c, as do custom fields. |
| Lookup versus master-detail relationship? | Core admin question | In master-detail, the detail record cannot exist without its master, inherits its owner and sharing, is deleted when the master is deleted, and the master can hold roll-up summary fields. A lookup is optional by default, keeps its own owner and sharing, and lets you choose what happens on delete. |
| How do you build a many-to-many relationship? | Data modeling | A junction object with two master-detail relationships, one to each parent, such as a Job Application object between Candidate and Position. |
| Can you roll up values across a lookup? | Workarounds | Not with a standard roll-up summary field. Use a record-triggered Flow, Apex, or an installed app built for lookup roll-ups, and think about recalculation when children are deleted or reparented. |
| What is a record type used for? | Configuration | Offering different picklist values, page layouts and business processes for the same object, such as separate sales processes for new business and renewals. |
| What is an external ID field? | Integration | A field marked as an identifier from another system, indexed and usable in upsert, so imports and integrations can match records without knowing Salesforce IDs. |
| What is a formula field versus a roll-up summary? | Field types | A formula is calculated on read from fields on the record or its parents. A roll-up summary on a master aggregates its detail records (count, sum, min, max) and is stored. |
| What does a validation rule do? | Data quality | It evaluates a formula on save and blocks the save with an error message when the formula is true, for example a closed-won opportunity with no amount. |
Security and sharing
- Explain the layers of Salesforce security. Org level (who can log in, from where and when), object level (create, read, edit, delete per object), field level (which fields are visible or editable) and record level (which specific records a user can see).
- Profiles versus permission sets? Every user has exactly one profile that sets baseline settings. Permission sets add permissions on top and can be assigned to many users; permission set groups bundle them. Salesforce's guidance is to keep profiles minimal and grant access through permission sets.
- What are organization-wide defaults? The baseline record access for each object: private, public read only, public read/write, or controlled by parent for detail objects. Set them to the most restrictive level any user needs, then open access up.
- How does the role hierarchy affect access? Users can see and usually edit records owned by people below them in the hierarchy. It opens record access upward; it does not grant object permissions.
- What are sharing rules? Automatic exceptions to org-wide defaults that share records with groups or roles, either by owner (records owned by the east team) or by criteria (cases where region is east).
- A user cannot see a record. How do you troubleshoot? Check object permission first, then the org-wide default, the record owner's place in the role hierarchy, sharing rules, manual shares and team membership. The sharing button on the record and the user's access summary help confirm it.
- What is field-level security and why does it matter for code? It hides or locks individual fields. Apex runs in system mode by default and ignores it, so code that shows data to users should enforce it, for example with user-mode queries or by stripping inaccessible fields.
Automation: Flow and friends
| Question | What it tests | What a strong answer shows |
|---|---|---|
| Which Flow types exist and when do you use each? | Flow literacy | Screen flows guide users through steps. Record-triggered flows run when records are created, updated or deleted. Schedule-triggered flows run on a timetable. Autolaunched flows are called from other flows, Apex or buttons. Platform event-triggered flows react to events. |
| Before-save versus after-save record-triggered flow? | Performance | Before-save (fast field updates) changes fields on the triggering record before it is written, with no extra DML. After-save can create or update related records and send notifications, at higher cost. |
| What happened to Workflow Rules and Process Builder? | Platform direction | Salesforce has retired both in favor of Flow and offers a migration tool. New automation should be built in Flow, and interviewers like to hear that you have migrated old rules. |
| Flow or Apex: how do you decide? | Judgment | Flow for most record updates, notifications and guided screens, which admins can maintain. Apex for complex logic, heavy data volumes, callouts with intricate error handling, or when a flow becomes too large to reason about. |
| How do you stop automation from looping or conflicting? | Design | Keep one record-triggered flow per object and timing where practical, set entry conditions so it runs only when relevant fields change, and document the order of automation on busy objects. |
| What is an approval process? | Business processes | A defined set of steps for approving a record, with entry criteria, approvers, and actions on approval, rejection or recall, such as locking the record. |
Apex, triggers and governor limits
- What are governor limits and why do they exist? Per-transaction caps on things like SOQL queries, DML statements, rows retrieved, CPU time and heap size. Many customers share the same infrastructure, so one org's code cannot be allowed to monopolize it. Limits are higher for asynchronous Apex.
- What does bulkification mean? Writing code that handles a whole collection of records with a fixed number of queries and DML statements, never one per record. Triggers receive records in batches, and data loads or integrations send many at once.
- What are the most common limit mistakes? SOQL queries or DML statements inside a for loop, querying fields you do not use on large sets, and recursive triggers that update the same records again.
- Before trigger or after trigger? Before triggers change fields on the records being saved, with no DML needed. After triggers work with related records or need the saved record's Id, such as creating child records.
- What is the one-trigger-per-object pattern? A single trigger per object that delegates to a handler class. It makes execution order predictable, keeps logic testable and makes it easy to switch behavior off.
- How do you prevent trigger recursion? Track processed record Ids in a static set in the handler and skip records already handled in this transaction, or compare old and new values so updates that change nothing do no work.
- What are with sharing, without sharing and inherited sharing? Keywords on a class that decide whether the running user's record sharing applies. With sharing enforces it, without sharing ignores it, and inherited sharing takes it from the caller. None of them enforces object or field permissions.
- Which kinds of asynchronous Apex are there? Future methods for simple fire-and-forget work, Queueable for jobs that need complex parameters or chaining, Batch Apex for processing very large record sets in chunks with fresh limits per chunk, and Schedulable for running at set times.
trigger OpportunityTrigger on Opportunity (after insert, after update) {
OpportunityTriggerHandler.afterSave(Trigger.new, Trigger.oldMap);
}
public with sharing class OpportunityTriggerHandler {
public static void afterSave(List<Opportunity> newList, Map<Id, Opportunity> oldMap) {
Set<Id> accountIds = new Set<Id>();
for (Opportunity opp : newList) {
Opportunity old = (oldMap == null) ? null : oldMap.get(opp.Id); // oldMap is null on insert
Boolean becameWon = opp.IsWon && (old == null || !old.IsWon);
if (becameWon && opp.AccountId != null) {
accountIds.add(opp.AccountId);
}
}
if (accountIds.isEmpty()) {
return;
}
List<Account> toUpdate = new List<Account>();
for (Account acc : [SELECT Id, Customer_Since__c FROM Account
WHERE Id IN :accountIds AND Customer_Since__c = null]) {
acc.Customer_Since__c = Date.today();
toUpdate.add(acc);
}
update toUpdate; // one DML statement for the whole batch
}
}SOQL, SOSL, testing and Lightning Web Components
| Question | What it tests | What a strong answer shows |
|---|---|---|
| SOQL versus SOSL? | Querying | SOQL retrieves records from one object and its related objects with exact filters, like SQL SELECT. SOSL runs a text search across several objects at once using the search index, which suits a global search box. |
| How do you query parent and child records together? | Relationships | Dot notation for parents (Contact.Account.Name) and a nested subquery on the child relationship name for children (SELECT Name, (SELECT LastName FROM Contacts) FROM Account). |
| What test coverage does Salesforce require? | Deployment rules | At least 75% Apex code coverage across the org to deploy to production, and every trigger must have some coverage. Good teams aim for assertions on behavior, not just the number. |
| How do you write a good Apex test? | Testing practice | Create test data in the test (no reliance on org data), use Test.startTest and Test.stopTest to reset limits and run async work, test bulk inputs, test as a restricted user, and assert outcomes. |
| What are the main LWC decorators? | Front end | @api exposes a public property or method to parent components, @wire connects a property or function to a data source such as an Apex method or a Lightning Data Service adapter, and @track is now needed only to observe changes inside objects and arrays. |
| LWC versus Aura components? | Platform history | LWC is built on web standards (custom elements, modern JavaScript) and is lighter and faster. Aura is the older framework. Aura components can contain LWCs, but not the other way around. |
| What is Lightning Data Service? | Data access | A client-side layer that loads, caches and saves records for components without Apex, respecting sharing and field-level security, and keeps components showing the same record in sync. |
| What causes a mixed DML error? | Gotchas | Changing setup objects (such as users or permission set assignments) and regular data in the same transaction. Move one part to an asynchronous job, or use System.runAs in tests. |
SELECT Name, Industry, Owner.Name,
(SELECT LastName, Email FROM Contacts WHERE Email != null)
FROM Account
WHERE Industry = 'Healthcare' AND CreatedDate = LAST_N_DAYS:30
ORDER BY Name
LIMIT 50
FIND {Northwind} IN NAME FIELDS
RETURNING Account(Name, Industry), Contact(FirstName, LastName, Email)Senior and scenario questions
- Sales reps must see all accounts but only their own opportunities. How do you set it up? Account org-wide default public read only (or read/write if they edit), opportunity org-wide default private, the role hierarchy for managers, and sharing rules for any team that needs exceptions.
- An import of 100,000 records fails with limit errors from your trigger. What do you check? Queries or DML inside loops, recursion between triggers and flows, and heavy synchronous work that belongs in a Queueable or Batch job. Then rerun with a smaller batch size to confirm.
- How would you integrate Salesforce with an ERP for orders? Decide the system of record per object, use external IDs and upsert for idempotent loads, platform events or change data capture for outbound changes, named credentials for authentication, and retries with error logging for callouts.
- How do you move changes from sandbox to production? Change sets for simple admin work, or the Salesforce CLI with source tracking, version control and a pipeline (or DevOps Center) for teams. Run tests in a full or partial copy sandbox before release.
- A page is slow because of a big report-style query. What can you do? Make filters selective on indexed fields, avoid querying unneeded fields, paginate, move aggregation to a scheduled job that stores results, or use a report instead of custom code.
Fictional example
- Interviewer
- A regional sales manager says she cannot open an opportunity owned by one of her reps. Everyone else on the team can. What do you check?
- Candidate
- Since others can see it, her object permissions are probably fine, but I would confirm she can read opportunities at all through her profile and permission sets. Then record access. The opportunity default is likely private, so she should see it through the role hierarchy. I would check her role and the rep's role: if the rep was recently moved to a different branch of the hierarchy, or the manager has no role assigned, the hierarchy will not give her access. I would also check who actually owns the record, because a lead conversion or a data load may have left it owned by an integration user. The record's sharing detail shows exactly who has access and why, which confirms the cause quickly. Once I know it, the fix is usually a role correction or an ownership change, and if the business wants regional access regardless of owner, a criteria-based sharing rule on region.
How to prepare for Salesforce interview questions
- Use a free developer orgBuild a small app: two custom objects in master-detail, a junction object, a validation rule, a record-triggered flow and a report.
- Practice the sharing modelCreate users in different roles, set org-wide defaults to private, and get access working through the hierarchy and a sharing rule. Then break it and troubleshoot.
- Write and test one trigger properlyA handler class, bulk-safe logic, recursion protection, and a test that inserts many records as a restricted user.
- Know the platform directionBe ready to explain why new automation goes in Flow, how permission sets replace profile-heavy setups, and where LWC fits.
- Prepare storiesA messy org you cleaned up, a user adoption problem, and a requirement you solved without code. Admin and consultant interviews lean on these.
Salesforce teams usually work in sprints, so expect process questions as well; Agile and Jira interview questions covers them. Many Salesforce projects integrate with ERP systems, which SAP interview questions explains from the other side. For the stories part of the loop, use the behavioral interview questions guide.
Sharing and trigger scenarios are easier to answer once you have said them out loud a few times. Natively, an AI interview assistant for Mac and Windows, transcribes a mock admin or developer round, can show an answer suggestion beside what you are saying, and reads an Apex class, a Flow canvas or a setup screen from a screenshot. With Pro or the free trial it takes your résumé and the job description into account, and every practice session's transcript and notes remain for review.
Questions people ask
What are common Salesforce admin interview questions?
Lookup versus master-detail, junction objects, record types, validation rules, profiles versus permission sets, org-wide defaults, the role hierarchy and sharing rules, troubleshooting record access, and which Flow type to use.
What are common Salesforce developer interview questions?
Governor limits and bulkification, before versus after triggers, the one-trigger-per-object pattern, recursion, async Apex (future, Queueable, Batch, Schedulable), test coverage rules, SOQL versus SOSL, and LWC decorators.
What is the difference between lookup and master-detail in Salesforce?
Master-detail makes the child depend on the parent for its existence, ownership and sharing, deletes children with the parent, and allows roll-up summary fields. Lookup is a looser, usually optional link without those effects.
Why do governor limits matter in a Salesforce interview?
They show whether you write code for a shared, multi-tenant platform. Interviewers expect bulk-safe code with no queries or DML inside loops and heavy work moved to asynchronous Apex.
Where to go next
Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.
Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.
