A candidate recites governor limits with total confidence, and you have no way to tell whether the numbers came from a production org or an old tutorial. Salesforce’s own documentation is now at Winter ’27, and the limits and defaults it lists are what you should be hiring against, whether you’re the interviewer or the candidate.
HyphenX works with teams that hire and extend Salesforce developers. Our hiring guide for Salesforce developers covers how to define the role, and the Apex governor limits documentation holds the numbers behind every question here.
What a Good Apex Interview Loop Actually Measures
An Apex loop works when every stage tests one competency and every question maps to it. Salesforce Apex interview questions that wander across topics produce impressions, and questions tied to a competency produce evidence. Five competencies cover most of what a Salesforce Apex developer does day to day.
- Language and design. Classes, interfaces, collections, handler patterns and clear naming. Listen for code that a second developer could pick up and maintain.
- Data access and limits. SOQL, DML and the governor limits that cap them. A strong candidate explains why a limit exists and what the number is.
- Triggers and automation. Context variables, bulk-safe patterns and order of execution for Apex triggers. Questions in this area expose a candidate’s habits quickly.
- Async and integration. Asynchronous Apex in all its forms, including future methods, Queueable jobs, Batch Apex, scheduled jobs and callouts. Look for reasoning about volume and failure.
- Testing and security. Meaningful assertions, mocks, sharing keywords and user mode. Together they separate code that works from code that is ready for production.
Teams that outsource Apex development work still need someone in the room who can ask these questions.
Why Version-Specific Knowledge Matters in an Apex Interview
Apex tutorials stay online long after the platform moves on. An answer can be correct for an org built years ago and wrong for the release you run today, so version awareness is worth testing directly.
- Sharing defaults changed at API version 67.0
A class with no sharing keyword defaults to with sharing in API version 67.0 and later. In 66.0 and earlier, the mode depends on the inheritance chain, the entry point and the caller, according to Salesforce’s sharing keywords documentation. - Apex runs in user context by default from the same version
In API version 67.0 and later, Apex runs in user context by default, and earlier versions default to system mode. A candidate who learned on older orgs may describe the opposite and still be right for those orgs. - Limits tables get revised
The current limits page lists heap at 10 MB synchronous and 25 MB asynchronous, and the documentation’s latest release is Winter ’27, API version 68.0. A good answer says where a number comes from.
Ask which API version the candidate is assuming, and score the reasoning instead of the number. Someone who names the version has worked across orgs of different ages. Someone who can’t may be reciting a tutorial.
This matters most for security questions, where the defaults changed at 67.0, and for limits questions, where figures should come from the current documentation. A wrong assumption in either area can ship a real defect. It also helps candidates: naming the version you assume turns a risky guess into a sound answer.
Governor Limits Every Apex Candidate Should Be Able to Explain
Governor limits exist because Apex runs on a shared platform, so a strong answer explains the reason behind a number. Asking “why does this limit exist and how do you design around it” tells an interviewer more than a recited figure does.
Limit | Synchronous | Asynchronous | A strong candidate adds |
|---|---|---|---|
SOQL queries issued | 100 | 200 | Collects IDs first and queries once |
Records retrieved by SOQL | 50,000 | 50,000 | Filters in the query itself |
DML statements | 150 | 150 | Gathers records into collections before one DML call |
Records processed by DML | 10,000 | 10,000 | Moves very large volumes to async work |
Callouts per transaction | 100 | 100 | Keeps callouts out of loops |
Cumulative callout timeout | 120 seconds | 120 seconds | Knows the default timeout is 10 seconds |
Heap size | 10 MB | 25 MB | Avoids holding full result sets in memory |
CPU time | 10,000 ms | 60,000 ms | Moves heavy processing to async work |
Rows from Database.getQueryLocator | 10,000 | 10,000 | Knows a Batch Apex QueryLocator can return 50 million |
Two clarifications matter here. The 10,000 row cap applies to Database.getQueryLocator in a normal transaction, while a Batch Apex Database.QueryLocator can return up to 50 million records. For Batch Apex, limits reset for each execution of the execute method.
HyphenX checked every figure in this table against Salesforce’s documentation on October 15, 2026, when the latest release shown was Winter ’27, API version 68.0. Limits change between releases, so a confident answer from an older org can sound correct and still be out of date.
Apex Trigger and Bulkification Questions With Strong-Answer Signals

Trigger questions carry the most signal, because a single bulk-unsafe pattern can break a data load. These seven Apex triggers questions run from context variables to order of execution, and they make a solid core for a list of Salesforce Apex interview questions.
- What’s the difference between Trigger.new and Trigger.newMap, and when is each unavailable? Listen for: newMap is available in before update, after insert, after update and after undelete, but not in before insert or before delete, and new is not available in delete triggers.
- Which context variables does a before delete trigger give you? Listen for: old and oldMap, with nothing available from new or newMap, so the logic reads the deleted records’ values from the old versions.
- What does it mean that every trigger is a bulk trigger? Listen for: planning for more than one record at a time, and naming sources such as data import, Bulk API calls, mass actions and recursive logic that fires bulk DML.
- How would you avoid a query inside a loop? Listen for: passing the IDs from Trigger.new into a set, running one query with that set, adding changes to collections and running DML once.
- When would you pick a before trigger over an after trigger? Listen for: before triggers run ahead of custom validation rules, so they suit changes to the incoming record, while after triggers run once the record is saved but before commit, so they suit work that needs the record to exist.
- How do you stop trigger logic from running twice in one transaction? Listen for: awareness that a recursive save can fire a trigger again, a plan to detect it, and caution about guards that hide real defects.
- Where does your trigger sit in the order of execution? Listen for: before-save flows first, then before triggers, then validation, then after triggers, with after-save flows later, and awareness that a recursive save skips some of the later steps.
A candidate who handles questions 3 and 4 cleanly has usually seen a real bulk load, and scenario based interview questions later in the loop will confirm it. If they stumble there, slow down and ask for a code sketch before moving on. The context variables documentation lists exactly which variables exist in each event, and teams that customize Salesforce with Apex for production should expect every answer to match it.
How Do You Ask About Sharing, Security and User Mode?
Security questions are where memorized lists fall apart, because the right answer depends on how a class is called. Salesforce’s secure coding guide describes SOQL injection as a bypass of CRUD and field-level security checks, which makes it a fair test of whether a candidate thinks about the person running the code. Five questions cover the ground.
- What do with sharing, without sharing and inherited sharing do? The first enforces the running user’s sharing rules and the second doesn’t, while the third runs without sharing only when a without sharing context calls it and runs with sharing otherwise.
- How do you check which sharing mode a class runs in? Read the class declaration first, then look at the entry point and the caller, because inherited sharing and the API version both change the result.
- Does a sharing keyword enforce field-level security? No. Sharing declarations don’t enforce object-level access or field-level security, so a strong answer names a second mechanism.
- How do you enforce permissions in a query and in DML? WITH USER_MODE in SOQL, as user in DML and AccessLevel.USER_MODE on Database methods, all described in the user mode documentation.
- How do you defend against SOQL injection? Bind variables in the WHERE clause. The secure coding guide does not recommend escaping single quotes, allowlisting or typecasting except in edge cases.
Ask for a short code sketch, because a candidate who has written the query with a bind variable usually writes it quickly. One who hasn’t tends to fall back on a definition.
Asynchronous Apex Compared: Future, Queueable, Batch, Scheduled and Cursors
Asynchronous Apex questions test whether a candidate can match a mechanism to the job. The table below gives the documented rules so an interviewer can check an answer without guessing, and a candidate can use it as a study sheet.
Mechanism | Best used for | Rules and limits | Follow-up to ask |
|---|---|---|---|
Future method | Short async work and callouts with callout=true | Static, returns void, takes primitive parameters only, can’t call another future method, and Salesforce recommends Queueable instead | Why did Salesforce steer teams toward Queueable? |
Queueable | Longer async work that carries object state | Accepts non-primitive members and returns a job ID. Allows 50 jobs from a synchronous transaction and 1 from an asynchronous one. Default chain depth is 5 in Developer and Trial orgs | How many follow-up jobs can one running job enqueue? |
Batch Apex | Large record sets | start, execute and finish. Scope is 200 by default and up to 2,000 with a QueryLocator. Each execution is a discrete transaction | When do you need Database.Stateful? |
Scheduled Apex | Time-based jobs | Schedulable interface, 100 scheduled jobs at one time, and synchronous web service callouts aren’t supported | How would you call an external service from a schedule? |
Apex Cursors | Splitting a large query result into pieces | Up to 50 million rows per cursor, 100 fetch calls per transaction and 10,000 standard cursors per org per 24 hours | When would you pair a cursor with Queueable jobs? |
Queueable jobs also support Transaction Finalizers, which attach recovery actions when a job fails, and each parent job can have only one child job. The Queueable documentation, the Batch Apex documentation and the Apex Cursors documentation cover each rule in full.
A useful question among Salesforce Apex interview questions on async work is what the candidate would do when a chained job fails midway. Listen for Transaction Finalizers and a plan to keep the work safe to rerun. Salesforce also states that cursors combined with chained Queueable jobs are an alternative to Batch Apex, so a candidate who proposes either for a very large job can be right. Callouts need the same care, and our API integration work shows how often async design and integration design overlap.
Which Apex Testing Questions Reveal Real Habits?
Testing answers show whether a candidate has shipped code through a deployment. A coverage number is easy to quote, and the better questions ask what the tests actually prove.
- Coverage that means something
Unit tests must cover at least 75% of Apex code, all of them must pass, and every trigger needs some coverage. Ask what the assertions prove, and listen for use of the Assert class, which Salesforce’s testing guidance recommends. - Bulk behavior
Salesforce’s testing best practices advise using at least 20 records to exercise bulk trigger behavior. Ask how the candidate would prove a trigger handles a batch and not just one record. - Start and stop
Code between Test.startTest and Test.stopTest gets a new set of governor limits, each test method can call them only once, and asynchronous work runs synchronously when stopTest executes. Test data belongs before startTest. - Callouts and setup objects
HttpCalloutMock with Test.setMock returns a fake response so no real callout is made. For mixed DML in tests, System.runAs is the documented workaround, as the mixed DML documentation explains.
A candidate who creates the data inside the test has written tests under real pressure, because a test can’t count on data in a particular org. That habit predicts clean deployments better than any coverage figure.
Ask the candidate to describe the last test that caught a real defect. Candidates who write tests to catch problems can usually name one, and candidates who write them only for the coverage number often can’t.
Scenario Based Interview Questions That Show Design Judgment
Scenario based interview questions reveal how a candidate combines everything above, which is why they belong late in the loop. Each of these scenario based interview questions has one sound pattern and one common failure, and the interviewer’s job is to push on the failure.
Scenario | Prompt to give | A strong answer includes | A common failure |
|---|---|---|---|
Single primary contact | Prevent more than one primary contact per account. | Account IDs from Trigger.new in a set, one query, an error on the offending records and a test against a batch | A query inside a loop, or a check that handles one record at a time |
Nightly update of millions of records | Update a field on every record each night. | Batch Apex or a cursor with chained Queueable jobs, a chosen scope size, state kept only when needed and a plan for failures | One synchronous update that runs into the 10,000-record DML limit |
Callout when a deal closes | Notify an external system when an opportunity closes. | An asynchronous callout through a Queueable job and a mocked response in tests | A callout inside a loop and no mock in the test |
User and record in one transaction | Create a user and an account in the same transaction. | Recognition of mixed DML, since setup objects such as User can’t be combined with non-setup objects in one transaction, and a separate transaction for the setup work | Both inserts in one transaction and no test that exercises it |
Scenarios work because they force a candidate to connect topics that tutorials teach separately. Some are better solved without code, and a good candidate says so. Our decision framework for Flow versus Apex covers that call in depth, and it gives interviewers a fair way to judge an answer that picks the declarative route.
How to Build an Apex Skills Test in 90 Minutes
A skills test earns its place when it is written before the candidate arrives and scored against the same expectations every time. Five steps produce a test you can reuse for every candidate at one level.
- Pick three competencies. Choose from the five in the first section, based on what the role touches daily.
- Write one task per competency. Leave each requirement slightly incomplete, so the candidate has to ask questions before coding.
- Set the time boxes. Give 10 minutes for setup, 60 minutes for the work and 20 minutes for a walkthrough of the solution.
- Write the expected solution first. List the common failures alongside it, such as a query in a loop, so scoring isn’t improvised.
- Pilot it on a colleague. Fix any ambiguity in the wording or the expected solution, then freeze the test so every candidate sees the same version.
Reuse the frozen version for every candidate at that level. A test that changes between interviews makes scores impossible to compare, and scores that can’t be compared add time without adding evidence.
Weight the choice to the role: a support-heavy org may lean on Apex triggers, and an integration-heavy org may lean on asynchronous Apex. Candidates benefit too, because a clear time box and a stated scoring method let them show their best work and leave knowing how the team thinks about code.
Four Exercises Worth Running With a Candidate
Different exercises expose different skills, so most loops need only one or two of the four.
- Live coding
Write a trigger, a handler class and a test class for a small requirement in 45 to 60 minutes. Watch for clarifying questions first, bulk-safe code and tests that assert something. - Take-home
Build a small Queueable or Batch job with tests, and state the time budget in the instructions, such as two hours. Review it in a live walkthrough, because the walkthrough shows whether the candidate understands what they submitted. - Code review
Hand over a 40-line handler with eight planted defects: a query in a loop, DML in a loop, a callout in a loop, hard-coded record IDs, a missing sharing keyword, SOQL built from user input, no null checks and a test with no assertions. Allow 20 minutes and watch which issues the candidate ranks first. - Debugging
Provide a failing test or a limit exception log and allow 20 to 30 minutes. Watch for a candidate who reads the error, forms a hypothesis and fixes the cause instead of the symptom.
Decide in advance whether candidates may use AI tools and say so in writing, because silence leaves both sides guessing. Whatever you allow, ask the candidate to change their own solution live and to explain a line they didn’t type, because a walkthrough shows understanding in a way a finished file can’t. Our post on how AI is changing Salesforce hiring covers how that shift affects the skills teams look for.
A Scoring Rubric You Can Copy
A rubric turns Salesforce Apex interview questions and exercises into a comparable score. This one is a recommended framework from HyphenX, built from the competencies on this page. It has no measured hiring data behind it.
Competency | Weight | 1 Weak | 2 Developing | 3 Solid | 4 Strong |
|---|---|---|---|---|---|
Triggers and bulkification | 20% | Query or DML inside a loop | Bulk-safe with gaps | Bulk-safe with a clean handler | Also explains order of execution and recursion |
Data access and limits | 20% | Quotes numbers without reasons | Knows the main limits | Explains why limits exist and designs around them | Also names the API version behind each answer |
Async and integration | 15% | Can’t choose a mechanism | Names the options | Chooses with reasons | Also plans for failure handling |
Security | 15% | Ignores sharing and permissions | Names the sharing keywords | Uses user mode and bind variables | Also explains the 67.0 defaults |
Testing | 15% | Chases coverage only | Asserts one path | Asserts, tests bulk and mocks callouts | Builds data in the test and covers failures |
Trade-off communication | 15% | Vague or silent | Explains when prompted | Explains unprompted | Compares options and states the risks |
Shift the weights by level. For a junior role, use 25% for triggers, 25% for data access, 10% for async, 10% for security, 20% for testing and 10% for communication. For a senior role, use 15%, 15%, 20%, 20%, 15% and 15%.
Score alone before the debrief, then compare. Treat a one-point gap between interviewers as ordinary variation, and treat a gap of two or more as a reason to compare the evidence. At the base weights, a candidate who scores 3, 4, 2, 3, 3 and 3 lands at 3.05 out of 4.
What Junior, Mid, Senior and Architect Candidates Should Show
The same questions work at every level when the expectations change, and these descriptions are HyphenX’s recommended calibration. A junior candidate writes a bulk-safe trigger with a handler and a test that asserts. That candidate can name the main limits from the table and explain what happens when one is hit. A mid-level candidate structures handlers and tests cleanly and chooses between Queueable and Batch with reasons, and uses user mode and bind variables without being prompted.
A senior candidate owns failure handling and security design and reviews other people’s code. That candidate can also describe a production incident, what broke and what changed afterward. An architect designs across the org and decides between Apex and declarative tools, and sets the standards for testing and review that everyone else follows.
Candidates preparing for a loop can use the description for their level as a self-check before they apply. Those aiming at a junior or mid-level role can build the same habits through Salesforce developer training, and interviewers can keep the questions identical across levels while changing the weights.
What Does an Apex Interview Loop Cost in Engineering Hours?

An interview loop costs engineering time, and the cost is easy to estimate once you list what goes into it. Four drivers decide the total.
- Interviewer time per stage. Add every stage: the screen, the skills test review, the walkthrough and any panel.
- Panel size. Each extra interviewer multiplies the hours for that stage. A panel of three costs three times the hours of a single interviewer.
- Finalists per hire. The whole loop runs once for every finalist. Four finalists means four full loops for one hire.
- Prep time for the frozen test. Writing the tasks, expected solution and rubric is a one-time cost shared across every hire at that level.
The U.S. Bureau of Labor Statistics reports a May 2025 median wage of $135,980 for software developers, in its software developers outlook. Divided by 2,080 working hours, that is about $65 per hour of gross wage. A loop that uses 5.5 interviewer hours per finalist across 4 finalists is 22 hours, or roughly $1,440 in wages before overhead. The hours are assumptions, so replace them with your own, and treat the wage as a proxy, since it covers software developers in general.
When hiring takes longer than a project can wait, some teams extend capacity instead. HyphenX offers Salesforce staff augmentation and dedicated developers, and our comparison of consulting versus in-house teams covers the wider build-or-buy question.
Checklist and Red Flags Before You Make an Offer
☐ Freeze the skills test and pilot it on a colleague before the first candidate.
☐ Write the expected solution and the common failures before the test runs.
☐ Ask which API version the candidate assumes for sharing and limits.
☐ Ask for a bulk-safe trigger written in code.
☐ Ask one security question that needs a code sketch.
☐ Run one async scenario and listen for failure handling.
☐ Hear one production incident story, including what changed afterward.
☐ Match the finalist’s scores to the level descriptions before you set the offer level.
Use this list as the last gate, after the exercises and the rubric scores are in. Four patterns deserve a second look. A candidate recites limits without reasons, wraps a query in a loop without noticing, never mentions tests until asked, or can’t explain a single trade-off. Any one of them is worth a follow-up question before you decide.
Salesforce describes the Platform Developer credential as covering custom business logic and interfaces. Treat it as a starting signal, and let the exercises above show hands-on skill before you extend an offer.
Apex Engineers Who Know a Strong Answer
Writing a good Apex question is easier when you’ve shipped the code behind it. HyphenX Solutions has 250+ Salesforce professionals, including senior developers and architects who know what a strong answer looks like on triggers, limits and testing. If your interview loop needs another technical voice or a vetted developer to fill a seat, both come from the same bench. Learn about our developer bench.
Case Study: Three Prospecting Tools Connected Inside Salesforce
From Swivel-Chair Prospecting to Single-Click Pipeline
A B2B SaaS company running outbound sales on Salesforce Sales Cloud used Apollo, Lusha and Hunter for contact discovery, direct dials and email finding, and none of the three connected to Salesforce. Reps copied data between browser tabs and the CRM by hand, which created duplicate records and let unverified emails in. HyphenX connected the tools through their APIs and orchestrated them inside Salesforce, with waterfall logic that queries the best source first and falls back when it finds no match. A single-click button on Lead, Contact and Account records then checks for existing records and writes the new one with source attribution, after Hunter verifies the email. It shows the kind of API-driven Salesforce work where a developer’s answers on callouts and duplicate handling matter.
Key takeaway: Connecting the tools the team already owned into one Salesforce workflow removed the copy-and-paste between systems and gave every record a clear source.
Read the full case study: From Swivel-Chair Prospecting to Single-Click Pipeline. To explore more, visit our case studies.
FAQs
What Are the Most Common Salesforce Apex Interview Questions?
Salesforce Apex interview questions usually cover governor limits, trigger context variables and bulkification, sharing and user mode, async mechanisms such as Queueable and Batch, test classes and scenario questions. Each maps to documented behavior, so strong answers cite how the platform works and which API version they assume.
Do I Need to Memorize Governor Limits for an Apex Interview?
Know the shape of them and the reasons behind them. Per transaction, synchronous Apex allows 100 SOQL queries, 150 DML statements and 10 MB of heap, per the current documentation. Interviewers listen for how you design around a limit and which version you learned it from.
What Is the Difference Between Queueable and Batch Apex?
Queueable runs work asynchronously and accepts non-primitive members. It returns a job ID, and each job can chain one child. Batch Apex splits a large record set into scopes of 200 by default, runs each as a separate transaction and suits very large volumes.
How Do I Explain Bulkification in an Interview?
Say that every trigger can receive many records, so code must handle collections. Collect IDs into a set, run one query with that set, add changes to collections and run DML once. Mention that data import, Bulk API calls and mass actions all send multiple records at a time.
What Should an Apex Skills Test Include?
Include one task per competency you’re hiring for, such as a trigger with a test class, an async job and a security-sensitive query. Leave the requirements slightly incomplete so candidates ask questions, and write the expected solution and common failures before anyone sits the test.
How Long Should an Apex Coding Test Be?
We recommend 90 minutes: 10 minutes for setup, 60 for the work and 20 for a walkthrough. Live coding fits 45 to 60 minutes, and a take-home should state its time budget up front. Longer tests add burden for candidates, and shorter ones struggle to cover bulk behavior and tests together.
Should I Use a Take-Home Test or Live Coding?
Live coding shows how a candidate thinks and asks questions, and a take-home shows polish and test habits. Whichever you pick, finish with a live walkthrough where the candidate explains and modifies their own code. That step shows whether the work is theirs and whether they understand it.
How Do I Score an Apex Coding Test?
Use a rubric with weighted competencies and four anchored levels, such as triggers, data access, async, security, testing and communication. Have each interviewer score alone before the debrief. Treat a one-point gap as ordinary variation, and a gap of two or more points as a reason to compare the evidence.
How Do I Handle Candidates Using AI Tools in an Apex Test?
Decide in advance whether AI tools are allowed and tell candidates in writing. Then ask them to change their own solution live and explain a line they didn’t type. A walkthrough exposes gaps in understanding better than any attempt to detect which tool produced the code.
What Does With Sharing Do in Apex?
It enforces the running user’s sharing rules for the class. In API version 67.0 and later, a class with no keyword defaults to with sharing. Sharing keywords don’t enforce object-level access or field-level security, so user mode, WITH USER_MODE and as user handle those permissions.
Is 75% Code Coverage a Good Enough Answer in an Apex Interview?
Salesforce requires unit tests to cover at least 75% of Apex code, with all tests passing, and every trigger needs some coverage. Interviewers want more than the number. Describe what your assertions prove, and explain how you test bulk behavior and mock callouts.
Do I Need Lightning Web Components Knowledge for an Apex Developer Interview?
Expect some questions on how Apex is called from Lightning Web Components. Components import an Apex method and call it with @wire or imperatively, and Apex limits apply separately to each method invocation. Depth varies by role, so ask the hiring team how much front-end work the job includes.
What Is Mixed DML and How Do I Avoid It?
Mixed DML is DML on setup objects, such as User, combined with DML on non-setup objects in one transaction. Salesforce documents separate transactions as the fix, with a future method as one route, and System.runAs for tests. Some setup objects have documented exceptions.
Can Scheduled Apex Make Callouts?
Synchronous web service callouts aren’t supported from scheduled Apex. Use Queueable Apex for an asynchronous callout, or a batch class that implements Database.AllowsCallouts, which scheduled Apex can run. Scheduled jobs are also capped at 100 at one time, so design schedules carefully.
Is a Platform Developer Certification Enough to Hire an Apex Developer?
Salesforce describes the credential as covering custom business logic and interfaces, so it shows study and exposure. Pair it with a practical exercise, such as live coding or code review, to confirm the candidate can write bulk-safe, tested Apex under real constraints.