Two tests share this name: Apex rounds for Salesforce developer jobs, and coding at Salesforce itself. What each asks, with a worked trigger fix.
"Salesforce coding interview" means one of two different tests, so start by working out which one you have. If you are applying for a Salesforce developer job, at a consultancy, a partner or a company that runs its business on the platform, the coding is Apex, SOQL and sometimes Lightning Web Components. Expect to fix or write a trigger that survives a 200-record data load, and to explain governor limits. If you are applying to Salesforce the company as a software engineer, the coding is general data structures and algorithms in a language you choose, plus system design. This page covers both, with a worked example, and flags four textbook Apex answers that are now out of date.
Software engineer candidates at Salesforce can read our walk-through of the software engineer interview process for the rounds that usually come before and after the coding interview.
Which test do you have?
- — Salesforce developer role (any employer) — Software engineer at Salesforce
- Language — Apex, SOQL, JavaScript for LWC — Your choice
- Typical coding task — Write or fix a trigger, a query, an async job or a test class — Algorithm problems, then practical coding and design
- What gets you marked down — Code that works for one record and breaks on a bulk load — Unclear reasoning, untested edge cases
- Best prep — Trailhead and your own org — Algorithm practice and system design
If the job post lists Apex, triggers or "governor limits", you are on the first track. If it is a Salesforce posting for a Member of Technical Staff (MTS) or Senior MTS (SMTS) role, you are on the second.
Track 1: Apex rounds for Salesforce developer roles
The task you are most likely to get: fix a trigger
The most common live exercise is a trigger that works in a demo and fails in production. Here is a typical version. The requirement: when an account's billing city changes, copy it to the mailing city of every contact on that account.
// The version that passes a one-record test and fails on a data load
trigger AccountCitySync on Account (after update) {
for (Account a : Trigger.new) {
List<Contact> contacts = [SELECT Id FROM Contact WHERE AccountId = :a.Id];
for (Contact c : contacts) {
c.MailingCity = a.BillingCity;
update c;
}
}
}What the interviewer wants you to see:
- A query inside a loop. Triggers run on batches of up to 200 records, and a synchronous transaction allows 100 SOQL queries. Update 200 accounts in one data load and this trigger tries 200 queries.
- DML inside a loop. One update per contact burns through the 150 DML statements a transaction allows.
- No change check. It rewrites every contact even when the city did not change, which wastes limits and fires any contact automation for nothing.
The fix:
trigger AccountCitySync on Account (after update) {
Set<Id> changed = new Set<Id>();
for (Account a : Trigger.new) {
if (a.BillingCity != Trigger.oldMap.get(a.Id).BillingCity) {
changed.add(a.Id);
}
}
if (changed.isEmpty()) return;
List<Contact> toUpdate = new List<Contact>();
for (Contact c : [SELECT Id, AccountId FROM Contact
WHERE AccountId IN :changed WITH USER_MODE]) {
c.MailingCity = Trigger.newMap.get(c.AccountId).BillingCity;
toUpdate.add(c);
}
if (!toUpdate.isEmpty()) {
update as user toUpdate;
}
}Why this is the strong answer: one query and one DML statement whatever the batch size. It compares Trigger.new with Trigger.oldMap (both available in an update trigger) so it only touches accounts whose city changed. It reads the new city from Trigger.newMap instead of re-querying accounts. And it uses the WITH USER_MODE and update as user syntax that Salesforce's own Trailhead examples now use, which tells the interviewer your knowledge is current.
Expect these follow-ups:
- "Where does this logic belong in a real project?" In a handler class, with the trigger only calling it. Trailhead recommends putting reusable logic in other classes to keep triggers small.
- "What if the running user cannot edit the mailing city?" User mode respects the user's object permissions and field-level security, so the save fails for that user. Say whether that is the behaviour the business wants, or whether this sync should run in system mode, and why.
- "Could a flow do this instead?" Yes, a record-triggered flow can. Talk about who maintains it, data volume and error handling, rather than declaring one tool always better.
Four textbook answers that are now out of date
Older question lists and study notes may still teach these, so check your material against current documentation. Giving the current answer is an easy way to stand out.
1. "Walk me through the order of execution." The old answer lists before triggers, validation, after triggers, workflow and commit, and leaves flows out. A Salesforce Ben summary (updated September 2026, based on the API v60 documentation) puts before-save record-triggered flows ahead of before triggers, and after-save record-triggered flows after the after triggers, assignment, auto-response, workflow and escalation rules. Entitlement rules, roll-up summaries and criteria-based sharing follow, then the commit, then post-commit work such as emails and async Apex. Mention that the order can differ by API version and that the list above follows the API v60 documentation, so check the current Apex Developer Guide for yours.
2. "Workflow rule or trigger?" Salesforce stopped letting orgs create workflow rules from Winter '23 and Process Builder processes from Summer '23, and recommends Flow Builder for new automation. The modern question is Flow or Apex. If the employer's org is older, add that existing workflow rules and processes still need migrating.
3. "Future method or Queueable?" The old answer treats them as equals with different features. Trailhead now says: "In general, we recommend that you use queueable Apex instead of Apex future methods." Know why. Future methods only take primitives (an sObject could change before the method runs), cannot call another future method, and do not run in a guaranteed order. Queueable jobs accept non-primitive members, return a job ID you can monitor, and can chain one child job.
4. "Does Apex run in system mode?" The classic answer is yes: Apex ignores the user's permissions unless you enforce them. Trailhead's DML unit now says "In API version 67.0 and later, Apex runs in user mode by default", meaning object permissions and field-level security are enforced unless a query or DML statement asks for system mode. Trailhead ties the user-mode default to API version 67.0 and later, so check which API version your org and classes use and what the Apex Developer Guide says for it. Trailhead also recommends declaring a sharing mode (with sharing and its alternatives) explicitly in every class, which is the safe habit either way.
The other questions worth preparing
These come up across developer interviews. Each line says what a good answer has to include.
- Governor limits. 100 SOQL queries per synchronous transaction (200 for asynchronous), 150 DML statements, triggers in batches of 200. The skill being tested is bulkification: collect IDs in a set, query once with IN :ids, write once from a list.
- Before or after trigger? Before triggers change or validate the records being saved, with no DML needed. After triggers are for system-set values such as the record ID and for changing other records; the triggering records are read-only. Know which context variables exist where: Trigger.old only in update and delete triggers, Trigger.new only in insert, update and undelete.
- Calling an external system from a trigger. It has to be asynchronous so the trigger is not waiting on a response. Trailhead's pattern is a Queueable class implementing Database.AllowsCallouts, enqueued with System.enqueueJob().
- Batch Apex. start, execute and finish; 200 records per execute by default; up to 50 million records through a QueryLocator; a fresh set of governor limits for every batch. Database.Stateful keeps instance variables between batches.
- SOQL or SOSL? SOQL queries one object at a time and matches exactly by default. SOSL searches text across many objects and matches on words. Be ready to write both relationship forms: SELECT Account.Name FROM Contact (child to parent) and an inner query on Contacts (parent to child).
- Partial success. Database.update(records, false) saves the good records and returns a Database.SaveResult for each one instead of throwing; a plain update throws a DmlException and stops. Say when you would want each.
- Testing. Deployment needs at least 75% of Apex covered with every test passing, and each trigger needs some coverage. Tests do not see existing org data by default, and their records roll back. Async work queued between Test.startTest() and Test.stopTest() runs synchronously at stopTest(), and callouts are faked with an HttpCalloutMock. A strong answer tests a 200-record insert, not one record.
- The sharing model. Object and field access through permission sets, then records: organisation-wide defaults set the most restrictive baseline, the role hierarchy opens records owned by people below you, sharing rules add exceptions for groups, and manual sharing lets an owner share one record.
- LWC calling Apex. A wired method must be cacheable, and a cacheable method cannot do DML. So reads can use @wire; anything that saves must be called imperatively.
For questions framed as business scenarios rather than code, see our Salesforce scenario-based interview questions. If your interview is with Accenture, its process and job-post skills are covered in our Accenture Salesforce developer guide.
Track 2: coding interviews at Salesforce itself
What Salesforce publishes
Salesforce's "How we hire" page does not list rounds, but it sets some rules worth knowing before you apply:
- It recommends applying to no more than three roles in a 12-month period.
- Most interviews are virtual on Google Meet, and candidates are expected to be on camera.
- An on-site interview at a Salesforce office is required before an offer.
- Interviewers may ask behavioural, competency-based or situational questions, so prepare real examples tied to the job description.
A May 2026 "Ask a Recruiter" post on the Salesforce blog adds that "technical candidates may complete an assessment demonstrating how they use AI." That is a change from the classic coding test. Ask your recruiter what your assessment involves rather than assuming.
What candidates report
None of this is official, so read it as a pattern, not a script:
- Aced (formerly Exponent) describes a 45-minute technical phone or video screen with a design problem and coding in your chosen language, a one-hour take-home HackerRank test that it says Salesforce calls its "remote programming test", and a final round of 45 to 60 minute interviews with the hiring manager, team members and other stakeholders. Its sample coding questions include checking whether a number is a power of two and the longest substring without repeating characters. Its system design examples include a multi-tenant CRM with data isolation. The page shows no absolute date.
- 1point3acres listed 20 candidate posts dated 16 July to 14 October 2026. Most are software engineering roles, and six titles mention MTS or SMTS, split across online assessments, phone screens and onsites. One title describes an assessment with "Medium LeetCode Questions", another an online assessment for a full-stack role "with AI Assistance", and one onsite covered a car reservation system with vendor integration as a design problem. The page shows titles only.
How to use that
Two things stand out when you put the sources side by side. First, for software engineer roles the reported "remote programming test" is a data structures and algorithms test rather than an Apex exam, so practise medium-level problems in the language you are fastest in. Second, Salesforce's own AI-assessment line and the "with AI Assistance" report point the same way: some assessments now look at how you work with AI, so be ready to explain what you asked a tool, what it got wrong and how you checked it.
The two tracks also meet in one place. Multi-tenancy is the reason governor limits exist, and it is also the core of design prompts like the data-isolated CRM. If you can explain why Salesforce caps queries per transaction, you already have the opening of that design answer.
A one-week plan
- Day 1. Decide your track from the job post. Copy every skill it names and rate yourself on each.
- Days 2 and 3 (track 1). Write the city-sync trigger above from memory, then move it into a handler class and write a test that updates 200 accounts. Repeat with a trigger of your own.
- Days 2 and 3 (track 2). Solve four or five medium problems against a one-hour timer, out loud, and test edge cases before you say you are done.
- Day 4. Rehearse the four out-of-date answers until you can give the current version without notes.
- Day 5. Prepare three STAR stories: a bug you traced, a limit you explained to a non-technical stakeholder, and a requirement that changed late.
- Days 6 and 7. Full mock interviews. When you practise algorithm problems, Verve AI's Coding Copilot can capture a problem from your screen and return a solution in languages including Java and Python, with quick actions such as Edge Case and Complexity. Solve the problem yourself first, then use it to compare edge cases and complexity with your own answer.
Sources
- Trigger batches of 200, 100/200 SOQL limits, 150 DML limit, bulk patterns, Trailhead examples using WITH USER_MODE and update as user: https://trailhead.salesforce.com/content/learn/modules/apex_triggers/apex_triggers_bulk
- Before and after triggers, read-only records in after triggers, context variables by event, asynchronous callouts from triggers via Queueable and Database.AllowsCallouts, logic in other classes: https://trailhead.salesforce.com/content/learn/modules/apex_triggers/apex_triggers_intro
- Future methods (primitive parameters and why, no future from future, order not guaranteed, Queueable recommended), Test.startTest/stopTest, HttpCalloutMock: https://trailhead.salesforce.com/content/learn/modules/asynchronous_apex/async_apex_future_methods
- Queueable (non-primitive members, job ID, one child job): https://trailhead.salesforce.com/content/learn/modules/asynchronous_apex/async_apex_queueable
- Batch Apex (start/execute/finish, default 200, 50 million via QueryLocator, fresh limits, Database.Stateful): https://trailhead.salesforce.com/content/learn/modules/asynchronous_apex/async_apex_batch
- User mode default in API 67.0 and later, object and field-level security, Database methods with allOrNone false, SaveResult, DmlException: https://trailhead.salesforce.com/content/learn/modules/apex_database/apex_database_dml
- Declaring a sharing mode explicitly in every class: https://trailhead.salesforce.com/content/learn/modules/apex_basics_dotnet/execution_context
- Relationship queries and bind variables: https://trailhead.salesforce.com/content/learn/modules/apex_database/apex_database_soql
- SOQL vs SOSL: https://trailhead.salesforce.com/content/learn/modules/apex_database/apex_database_sosl
- 75% coverage, trigger coverage, no org data by default, rollback: https://trailhead.salesforce.com/content/learn/modules/apex_testing/apex_testing_intro
- Sharing model layers and permission sets: https://trailhead.salesforce.com/content/learn/modules/data_security/data_security_overview
- @wire needs cacheable methods, cacheable methods cannot do DML, imperative calls: https://trailhead.salesforce.com/content/learn/modules/lightning-web-components-and-salesforce-data/use-apex-to-work-with-data
- Order of execution including before-save and after-save flows (Marlene Reeve, updated September 15, 2026): https://www.salesforceben.com/learn-salesforce-order-of-execution/
- Workflow rules (Winter '23) and Process Builder (Summer '23) creation cutoffs, Flow Builder recommendation: https://www.salesforceben.com/salesforce-to-retire-workflow-rules-and-process-builder/
- Salesforce hiring rules (three roles in 12 months, Google Meet on camera, on-site before offer, question types): https://www.salesforce.com/company/careers/culture/how-we-hire/
- Salesforce recruiter post on technical candidates' AI assessment (May 12, 2026): https://www.salesforce.com/blog/ai-skills-salesforce-candidates/
- Candidate-reported Salesforce SWE process and sample questions (Aced): https://www.aced.io/blog/salesforce-interview-process
- Candidate post titles, 16 July to 14 October 2026 (1point3acres): https://www.1point3acres.com/interview/company/Salesforce
- Coding Copilot (screen capture, languages, quick actions): https://docs.vervecopilot.com/features/coding-copilot
Ryan
CEO of Verve AI









