20 Senior Salesforce Developer Interview Questions and Answers

17 min read

A senior Salesforce developer owns the parts of an org that break in production when nobody's looking: a trigger that fires twice on a bulk update, an integration that hits a governor limit during a data load, a deployment that passed every test in a sandbox and still failed in production. Interviewers use these questions to check whether you've actually hit those walls, not just read about them.

The bar for "senior" here is specific: can you explain why a design choice avoids a governor limit, not just recite what the limit is, and can you defend a trigger or async architecture decision you made on a real project. Expect deep follow-ups on anything you claim to have built.

Most interviews mix Apex and SOQL fundamentals with real architecture questions: how you structure triggers across an org, how you've used asynchronous Apex under load, and how your team ships code without change sets turning into a bottleneck.

In This Article

Senior Salesforce developer at a glance

ItemDetails
Typical employersCompanies running Salesforce Sales Cloud, Service Cloud, or a custom platform build; Salesforce consultancies and implementation partners
Median pay$135,980 median annual pay for software developers in May 2025, the closest BLS category (BLS doesn't track "Salesforce developer" pay separately)
Job outlookSoftware developer employment projected to grow 10% from 2025 to 2035, much faster than average (BLS)
CertificationsNo license required; Salesforce Certified Platform Developer I and Platform Developer II are the most commonly requested; Platform Developer II requires holding Platform Developer I first
Key toolsApex, SOQL and SOSL, Lightning Web Components, Salesforce CLI (sf), Visual Studio Code, Git, Flow Builder, sandboxes and scratch orgs
Interview formatRecruiter screen, a technical round on Apex and architecture, often a live coding or code review exercise, and a behavioral round

How the interview usually works

  1. Recruiter or hiring manager screen. Confirms your Apex and LWC experience and how many orgs you've built or maintained.
  2. Technical round. Covers triggers, governor limits, async Apex, and SOQL, usually with follow-up "why" questions on every answer.
  3. Live coding or code review exercise. You write a trigger handler or LWC component, or review a piece of code for bugs and bulkification issues.
  4. Architecture discussion. For senior roles, how you'd design a trigger framework or an integration for an org with heavy data volume.
  5. Behavioral round. Past production incidents, deployment failures, and how you worked with admins or other developers.

General and background questions

1. Walk me through the largest Salesforce org you've built or maintained.

Why they ask: This tells them whether you've worked at a scale where governor limits and deployment complexity actually matter.

How to answer: Name the org's rough size, the main objects and automation, and one specific technical challenge.

Sample answer: I worked on an org with about 1.2 million Account records and roughly 40 active triggers across the main sales objects before we consolidated them. The biggest challenge was a nightly data sync from an ERP system that regularly hit the 10,000-record DML limit during month-end volume spikes. We rebuilt that integration around Batch Apex with a scope of 200 records per batch, which fixed the limit issue and cut the total sync time from around 3 hours to 45 minutes because it could process batches in parallel instead of one long synchronous job.

2. How do you decide whether a piece of logic belongs in Apex, Flow, or a validation rule?

Why they ask: This checks whether you default to code for everything, which creates unnecessary technical debt in orgs that admins also maintain.

How to answer: Give real criteria: complexity, performance needs, and who has to maintain it after you.

Sample answer: I use validation rules for simple field-level checks, Flow for business logic an admin might need to adjust without a deployment, and Apex when the logic needs something Flow can't do cleanly, complex SOQL, callouts, or performance-sensitive bulk processing. On a recent project, a discount approval process started as a Flow, but once it needed a real-time callout to a pricing API and had to run inside a trigger context safely, we moved it into a Queueable Apex class, since Flow's callout support inside a record-triggered context has real limitations around bulkification and governor limits.

3. What's changed the most about how you write Apex compared to a few years ago?

Why they ask: This checks whether your skills are current or frozen at whatever you learned when you started.

How to answer: Name a specific, real shift in tooling or practice, not a vague "I keep learning."

Sample answer: The biggest shift for me has been moving deployment away from change sets entirely, onto Salesforce CLI and source-tracked scratch orgs, which let our team run real code review on Apex changes before they ever touch a shared sandbox. I've also moved away from writing one trigger per use case toward a single trigger per object with a handler class, which used to be a "nice to have" and is now something I won't build without on any new org, since I've seen too many orgs where uncoordinated triggers on the same object caused unpredictable execution order.

Technical questions

4. How would you design a trigger framework for an org that's going to have multiple developers working on the same objects?

Why they ask: Trigger order and duplication cause some of the most common production bugs in multi-developer orgs.

How to answer: Describe a specific pattern: one trigger per object, a handler class, and how you'd control execution order.

Sample answer: I use exactly 1 trigger per object that delegates all logic to a handler class, with separate methods for each context, beforeInsert, afterUpdate, and so on, so nobody ever adds a second trigger on the same object out of convenience. Inside the handler, I keep a bypass mechanism, a custom setting or custom metadata flag, so a data migration or integration user can skip automation without commenting out code. On an org with 6 developers, we standardized on this pattern after finding 3 separate triggers on the Opportunity object written by different people over 2 years, with no defined order between them, which had caused a bug where 1 trigger read a field value another trigger hadn't updated yet.

5. What are Salesforce's governor limits, and name 3 that come up most often in real projects.

Why they ask: This checks whether you know the actual numbers, not just that limits exist in general.

How to answer: Name specific limits with their numbers and a real scenario where you hit one.

Sample answer: Governor limits cap how much a single transaction can do on Salesforce's shared infrastructure, and the 3 I run into most are 100 SOQL queries per synchronous transaction, 150 DML statements per transaction, and a 10,000-record limit per DML operation. I hit the DML record limit on a data cleanup script that tried to update roughly 25,000 records in one go, so I rewrote it as Batch Apex with a 2,000-record scope per batch, which processes well under the per-batch limit and lets Salesforce parallelize the batches instead of running one massive transaction.

6. Why does a SOQL query inside a for loop cause a problem, and how do you fix it?

Why they ask: This is one of the most common Apex anti-patterns, and it directly tests bulkification thinking.

How to answer: Explain why it multiplies query count with record volume, then give the actual fix.

Sample answer: A SOQL query inside a for loop runs once per iteration, so processing 200 records in a trigger means 200 separate queries, which blows past the 100-query synchronous limit long before you'd expect based on testing with a handful of records. The fix is to query once outside the loop, usually into a map keyed by the relevant ID, then look up records from that map inside the loop instead of querying again. I caught this exact bug in a code review on a trigger that worked fine in every test with 5 or 10 records, but would have failed instantly on any real data load or bulk API import.

7. How do you write a trigger so it behaves correctly whether it's processing 1 record or 200?

Why they ask: Bulkification is the single most tested Apex concept because it's the most common way junior code fails in production.

How to answer: Describe designing for Trigger.new as a collection from the start, not adding bulk support after the fact.

Sample answer: I write every trigger handler method to operate on the full Trigger.new or Trigger.newMap collection from the first line, never assuming a single record, and I collect any related IDs into a Set before running a single bulk SOQL query against it. On one project, I inherited a trigger that looped through Trigger.new, then ran a DML update inside that same loop for a related record; it worked in every manual test because someone always tested with 1 record at a time, and it failed the first time a real bulk data load ran 500 records through it at once, hitting the DML statement limit almost immediately.

8. What's the difference between a Queueable class and Batch Apex, and when would you use each?

Why they ask: Both handle asynchronous work, but picking the wrong one is a common design mistake.

How to answer: Give the real distinguishing factor: dataset size and chaining versus large-volume processing.

Sample answer: Queueable Apex is for a single unit of asynchronous work, often a callout or a job that needs to chain into another job afterward, and it gives you a job ID you can track. Batch Apex is built for processing large volumes of records in chunks, using a start, execute, and finish method, where Salesforce automatically breaks the record set into scopes and runs each scope in its own transaction with its own limits. I used Queueable for a single API callout that needed to update a record after a response came back, and Batch Apex for a monthly job re-scoring around 300,000 leads, since that volume would never fit inside 1 transaction's limits no matter how carefully I wrote it.

9. When would you use Platform Events instead of a trigger or a direct integration call?

Why they ask: Platform Events solve a specific decoupling problem, and this checks whether you understand what that is.

How to answer: Name the actual use case: decoupling publishers from subscribers, or getting data out to an external system in near real time.

Sample answer: I'd use Platform Events when multiple systems, inside or outside Salesforce, need to react to something happening without the publishing code needing to know who's listening. On a project where both an external inventory system and an internal Slack notification needed to react to a large order being created, we published a Platform Event from the order trigger instead of hardcoding calls to both integrations directly in that trigger. That meant adding a third subscriber later, a reporting pipeline, didn't require touching the original order trigger at all.

10. Walk through Salesforce's Apex test coverage requirements for a production deployment.

Why they ask: This is a specific, often-misunderstood rule, and getting it wrong signals you haven't actually shipped to production.

How to answer: State the exact thresholds: 75% overall, and the separate trigger minimum.

Sample answer: Salesforce requires at least 75% code coverage across all Apex in the org to deploy to production, but that 75% is an org-wide average, not a per-class minimum, so 1 well-tested class can offset a smaller, less-tested one. Separately, every trigger needs at least some test coverage of its own; a trigger with zero coverage blocks deployment even if the org's overall percentage is well above 75%. I aim for closer to 90% on new code regardless of the 75% floor, since I've seen coverage that just barely clears 75% miss real bugs that a more thoughtful set of test scenarios, especially bulk and negative test cases, would have caught.

11. What's a bulkified, well-structured Apex test class look like to you?

Why they ask: A lot of test classes exist only to satisfy the coverage number, and this checks whether you write tests that actually catch regressions.

How to answer: Name what you test beyond the happy path: bulk data, negative cases, and permission context.

Sample answer: A good test class creates test data using Test.startTest() and Test.stopTest() around the actual logic being tested, uses at least 200 records to catch bulkification issues the way real usage would, and includes at least 1 negative test that confirms the code fails or throws correctly on bad input, not just that it succeeds on good input. I also run at least 1 test method using System.runAs() with a restricted user profile, since I've had code pass every test as an admin user and then fail in production the first time a standard user without full object access ran it.

12. What are Lightning Web Components, and how do they differ from Aura components?

Why they ask: LWC is now the standard for new UI work, and this checks whether your knowledge is current.

How to answer: Name the underlying web standards and a real, practical difference in how you'd build with each.

Sample answer: Lightning Web Components are built on native web standards, JavaScript classes, HTML templates, and the Shadow DOM, instead of Aura's framework-specific component model, which makes LWC generally faster and easier to test with standard JavaScript tooling. In practice, I reach for LWC for any new component now, and I only touch Aura when I have to wrap an LWC inside an Aura component to use it in a context that still requires Aura, like certain older utility bar or quick action configurations that hadn't been migrated when I last worked with them.

13. How do you fetch and cache Salesforce data in an LWC without overloading Apex controllers?

Why they ask: This checks whether you understand the wire service and when to bypass it.

How to answer: Explain the @wire decorator's caching behavior and when an imperative Apex call makes more sense.

Sample answer: For data that loads once and doesn't need manual control over timing, I use @wire with a cacheable Apex method, since the Lightning Data Service layer caches results and automatically refreshes them when the underlying record changes elsewhere on the page. For anything triggered by a user action, like a save button, I call Apex imperatively instead, since @wire isn't meant for on-demand calls. On a dashboard component, switching a chart's data source from an imperative call on every render to a cacheable @wire method cut the number of Apex invocations by roughly 80% during normal use.

14. Change sets, SFDX, and a CI/CD pipeline: how do you decide which to recommend to a team?

Why they ask: Deployment strategy affects every developer on a team daily, and this checks whether you understand the tradeoffs instead of just preferring whatever you learned first.

How to answer: Give a real reason for each option, including when change sets are still defensible.

Sample answer: I recommend Salesforce CLI with source-tracked projects and a CI/CD pipeline, usually GitHub Actions or a similar tool running sf project deploy against a pipeline of sandboxes, for any team with more than 1 or 2 developers, since it gives you version control, code review, and repeatable automated tests before anything reaches production. Change sets still make sense for a very small, admin-heavy org with minimal custom code and no dedicated developer, since standing up a CI pipeline for that org would be more overhead than it's worth. I moved a 4-developer team off change sets after a change set deployment silently missed a dependent custom field, something that never would have gotten past a CI pipeline's validation step.

15. How would you design an integration that has to send Salesforce data to an external system without hitting callout limits?

Why they ask: Callout limits and timeout behavior trip up a lot of otherwise solid Apex developers.

How to answer: Name the specific limits and the asynchronous pattern you'd use to stay under them.

Sample answer: Synchronous Apex allows up to 100 callouts per transaction with a combined callout time limit, so for anything triggered by a bulk operation, I move the callout into a Queueable class instead of making it directly inside the trigger, since a trigger firing on 200 updated records could otherwise try to make 200 synchronous callouts in a single transaction. On an integration syncing case updates to an external support system, I batched updates into Queueable jobs of 50 records each, with retry logic built around a custom object logging failed callouts, so a downstream outage didn't silently drop updates.

Behavioral questions

16. Tell us about a production incident caused by a governor limit or an unbulkified trigger.

Why they ask: This checks whether you own mistakes and change your process, not just present clean successes.

How to answer: Name the specific failure, the immediate fix, and the process change afterward.

Sample answer: A trigger I'd written queried a related object inside a loop, and it worked fine through code review and testing with small batches. It failed during a data load that updated 3,000 Contact records at once, hitting the SOQL query limit and rolling back the entire load. I fixed the immediate issue by moving the query outside the loop into a single bulk query, and I added a required step to our team's pull request template asking reviewers to specifically check for SOQL or DML inside loops, since that's the single most common bug I've seen across every org I've worked on.

17. Describe a time you disagreed with another developer or an architect about a technical approach.

Why they ask: Senior developers often have to defend a design decision without just pulling rank.

How to answer: Describe the disagreement and how you resolved it with evidence, not authority.

Sample answer: An architect wanted to build a complex approval process entirely in Flow for a contract object with deeply nested conditional logic. I thought the branching was complex enough that Flow would become unreadable and hard to debug for whoever maintained it later. Instead of arguing it in the meeting, I built a small proof of concept of both approaches, the Flow version and an Apex-based version, and timed how long it took a different developer on the team to correctly trace a specific approval path in each. The Apex version took him about a third of the time to understand, and the team went with that approach based on that test, not just my opinion.

18. Tell us about a time you had to refactor legacy Apex code you didn't write.

Why they ask: Senior developers spend a lot of time in code they didn't write, and this checks how you approach it.

How to answer: Describe your process for understanding the code safely before changing it, and what you found.

Sample answer: I inherited an org with a 900-line trigger handler with no test coverage beyond a single happy-path test. Before changing anything, I wrote characterization tests that captured the current behavior, including behavior I suspected was a bug, so I'd know immediately if a refactor changed something unintentionally. That process actually surfaced a real bug: a discount calculation that used integer division instead of decimal division, silently rounding discounts down on about 15% of orders. I fixed that as a separate, called-out change rather than folding it into the refactor, so the business team could decide whether to backfill the affected orders.

Situational questions

19. A batch job that's run reliably for a year suddenly starts failing with a CPU time limit exception. How do you troubleshoot it?

Why they ask: This checks your diagnostic process when something that used to work stops working, rather than just guessing at a fix.

How to answer: Name the actual first checks: recent code changes, data volume growth, and debug log analysis.

Sample answer: First I'd check whether anything changed recently, a new trigger or validation rule on the same object that's now firing inside that batch's transaction, since a batch job's CPU time budget is shared with everything that runs during its execution, not just the batch class itself. If nothing changed in code, I'd check whether the underlying data volume grew enough that the batch's scope size no longer fits comfortably; a batch that processed 50,000 records fine a year ago can start timing out if that number doubled and nobody revisited the scope size. I'd pull a debug log with CPU time enabled to see exactly where the time is going before changing anything, rather than guessing.

20. You're asked to add a feature to a trigger, but the object already has 3 separate triggers from before your team standardized on 1 trigger per object. What do you do?

Why they ask: This tests whether you'll quietly add to existing mess or push for a fix, and how you'd handle it without breaking things.

How to answer: Describe a safe consolidation approach, not a risky big-bang rewrite in the middle of an unrelated feature request.

Sample answer: I wouldn't consolidate all 3 triggers as part of an unrelated feature request, since that risks introducing a regression under time pressure and makes the change hard to review. I'd ship the requested feature in the cleanest of the 3 existing triggers for now, then open a separate, scoped ticket proposing consolidation into a single trigger and handler, with characterization tests written first so we can prove the consolidated version behaves identically before switching over. That kept the immediate deliverable on schedule while giving the team a concrete, low-risk path to fix the underlying structural problem later.

Questions to ask the interviewer

  • How many active triggers, Flows, and integrations run against your most-used objects?
  • What does your deployment pipeline look like: change sets, SFDX and CI/CD, or a mix depending on the team?
  • What's the largest data volume issue your team has hit, and how did you solve it?
  • How do you handle technical debt from older Apex or Aura components that predate current standards?
  • Who reviews Apex code before it merges, and what does that review actually check for?
  • How much of this role is new feature development versus maintaining and refactoring what already exists?

How to prepare

  • Know the actual governor limit numbers. Be ready to state the SOQL, DML, and callout limits without hesitating, and explain why each one exists.
  • Practice explaining bulkification out loud. A lot of interviews ask you to spot a SOQL-in-a-loop bug in a code sample.
  • Review your trigger framework story. Be ready to describe a specific pattern you've used, not just "I follow best practices."
  • Know the difference between Queueable, Batch Apex, Future methods, and Platform Events cold. Interviewers often ask you to pick the right one for a scenario on the spot.
  • Bring a real deployment or incident story. A specific governor limit hit, a bad trigger, or a deployment failure shows more than a clean list of skills.

If the role leans more toward declarative automation than code, Salesforce Flow interview questions covers the adjacent skill set, and Salesforce business analyst interview questions is useful if the position blends requirements gathering with development work. For broader platform architecture questions, solution architect interview questions and data architect interview questions cover related design and integration territory.