Salesforce interview questions for 4 years experience
Questions for developers and admins who own features end to end, with answers built on real project examples.
On this page (8 sections)
What changes at 4 yearsOwnership and designCode quality and reviewsPerformance and dataDelivery and productionWorking with peopleAI and what you are learningHow to prepareFour years is the point where interviewers stop asking whether you can build something and start asking whether you can own it. You are expected to take a feature from requirement to production on your own, make sensible design choices, review other people's work and handle a production problem without waiting for a lead. You are not yet expected to design whole orgs, which is what 5 and 7 year interviews move towards.
The questions below are the ones that come up most at this level, for developers and for admins who work with code. Answer each with an example from your own projects. A short, specific story is worth more than a perfect definition.
What changes at 4 years
| At 2 to 3 years | At 4 years | At 5 years and above |
|---|---|---|
| Builds tasks given by a lead | Owns features end to end | Designs solutions across teams |
| Follows the team's patterns | Explains and improves the patterns | Sets the patterns |
| Fixes bugs assigned to them | Handles production issues and finds the cause | Prevents whole classes of issues |
| Gets code reviewed | Reviews other people's code | Decides the review standards |
Ownership and design
01Walk me through a feature you owned from requirement to production.
Walk me through a feature you owned from requirement to production.
What the interviewer is checking: Whether you made the decisions or just followed instructions. Naming the options you rejected, and why, is what shows ownership.
Pick one you know in detail, and tell it in five parts: the business problem, the options you considered, what you built and why, how you tested and released it, and what happened after go-live. For example:
"Sales wanted renewals created automatically 90 days before a contract ended. I considered a scheduled flow and Batch Apex. Because we had 400,000 contracts and needed to copy line items with pricing rules, I chose a nightly Batch Apex job with a custom metadata setting for the 90 days, so the business can change it. I wrote positive, negative and bulk tests, ran it against a full-copy sandbox, and released it with a switch to turn it off. It now creates about 1,200 renewals a month, and the team stopped tracking them in spreadsheets."
02Your org has five triggers on Opportunity, written by different people. How do you clean it up?
Your org has five triggers on Opportunity, written by different people. How do you clean it up?
Move to one trigger per object that calls a handler class, so the order of the logic is clear and controlled. I would:
- List what each trigger does and which events it runs on.
- Create one trigger with all the events, calling a handler with a method per event, such as
beforeUpdateandafterInsert. - Move each piece of logic into the handler (or a service class it calls), in the order the business needs.
- Add a bypass switch, for example a hierarchy custom setting or custom permission, for data loads and integrations.
- Run the existing tests plus new bulk tests, then retire the old triggers in the same release.
If the team already uses a trigger framework, I follow it rather than introduce a new one.
Common mistake: Rewriting all the logic at the same time. Move it first with the same behaviour, prove it with tests, then improve it in a later change.
03A field changes after save and nobody knows why. How does the order of execution help you find out?
A field changes after save and nobody knows why. How does the order of execution help you find out?
What the interviewer is checking: Practical use of the order of execution, not reciting it. Linking it to a debugging method scores best.
When a record is saved, Salesforce runs things in a fixed order: system validation, before-save flows, before triggers, custom validation rules, duplicate rules, the save itself, after triggers, assignment, auto-response and escalation rules, after-save flows, entitlement rules, roll-up summary updates to parents, and then the commit. Knowing the order tells you where to look. If the value is right after the before trigger and wrong at the end, something later changed it: an after-save flow, or a roll-up that updated the parent and fired its own automation.
A debug log with Apex and Workflow at a fine level shows each step in that order, so you can see the last thing that set the field.
04When do you use Custom Metadata Types, Custom Settings and Custom Labels?
When do you use Custom Metadata Types, Custom Settings and Custom Labels?
| Use | For | Example |
|---|---|---|
| Custom Metadata Types | Configuration that should deploy with your code | Discount thresholds, field mappings for an integration, feature switches |
| Hierarchy Custom Settings | Values that differ by user or profile | A bypass flag for the integration user |
| Custom Labels | Text shown to users, which can be translated | Error messages and button text |
The deciding question is usually: should this value move from sandbox to production with a deployment? If yes, Custom Metadata. Records of a Custom Metadata Type can also be read without using SOQL query limits.
05How do you avoid hardcoded IDs in Apex and flows?
How do you avoid hardcoded IDs in Apex and flows?
IDs differ between sandboxes and production, so hardcoded IDs break after a refresh or deployment. Instead:
- For record types, use
Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Partner').getRecordTypeId(). - For queues, groups and users, query by developer name or username.
- For anything the business may change, store the developer name in Custom Metadata and look up the ID at run time.
In flows, use Get Records on the developer name, or a constant that holds it, never the ID.
Code quality and reviews
06What do you look for when you review a colleague's Apex code?
What do you look for when you review a colleague's Apex code?
What the interviewer is checking: That you review for the things that break production (bulk, security, tests), not just formatting.
- Bulk safety: no SOQL or DML in loops, and logic that works for 200 records.
- Security: sharing declared on the class (
with sharingorinherited sharing), and object and field access enforced withWITH USER_MODEorAccessLevel.USER_MODEwhere users trigger the code. - Tests that assert the outcome, including a negative and a bulk case.
- No hardcoded IDs or magic numbers.
- Error handling that logs or tells the user something useful, not an empty
catch. - Readability: clear names, small methods, and logic in a service class rather than in the trigger.
I comment on the code, not the person, and separate must-fix issues from suggestions.
07When do you use with sharing, without sharing and inherited sharing?
When do you use with sharing, without sharing and inherited sharing?
with sharing applies the running user's record sharing, and is the safe default for code users trigger. without sharing ignores sharing, and should be limited to small, clearly named classes that must see all records, such as a job that recalculates totals across the org. inherited sharing takes the sharing of the class that called it, which suits utility and service classes used from many places. Remember that sharing controls which records are visible, not object and field permissions, which you enforce separately with user mode.
Common mistake: Saying with sharing also enforces field-level security. It does not.
Performance and data
08A Lightning record page with your LWC loads slowly. How do you make it faster?
A Lightning record page with your LWC loads slowly. How do you make it faster?
- Use
@AuraEnabled(cacheable=true)for read-only Apex, so results can be cached on the client. - Fetch only the fields and records you show, and page through long lists instead of loading thousands of rows.
- Combine several Apex calls into one where they always run together.
- Load data for tabs or sections only when the user opens them.
- Use Lightning Data Service (
getRecord,lightning-record-form) for single records, which shares a cache with other components on the page.
Measure first with the browser's developer tools, so you fix the real bottleneck.
09You need to load one million records into Salesforce. How do you plan it?
You need to load one million records into Salesforce. How do you plan it?
What the interviewer is checking: Whether you have done a real migration. Mentioning external IDs, bypassing automation and reconciling counts shows you have.
- Use a tool built for volume: Data Loader or another client using the Bulk API 2.0.
- Agree which automation should run during the load. Usually triggers, flows and validation rules are bypassed with a switch for the load user, and their effects (for example calculated fields) are loaded directly or recalculated afterwards.
- Load parents before children, and use external IDs to link them, so you do not need to look up Salesforce IDs.
- For a very large load, ask whether the org can defer sharing calculations, and avoid giving one user ownership of too many records, which causes ownership skew.
- Do a trial run in a full-copy sandbox, check the error files, and reconcile record counts afterwards.
10A callout to an external system sometimes fails. How do you make the integration reliable?
A callout to an external system sometimes fails. How do you make the integration reliable?
Use a Named Credential for the endpoint and authentication. Make the call asynchronously (Queueable with Database.AllowsCallouts) so a slow system does not block users. Record each attempt and its result, for example in a log object or a status field on the record. Retry temporary failures, such as timeouts and 503 errors, a limited number of times with a delay, and send permanent failures to a queue or report someone checks. If the other system supports it, send an ID with each request so a retry does not create duplicates.
Delivery and production
11Describe your team's deployment process.
Describe your team's deployment process.
Describe what you really use, with the reasons. A typical process at this level: each developer works in their own developer sandbox, code goes into Git through pull requests with a review, a pipeline (for example DevOps Center, GitHub Actions or a tool such as Copado or Gearset) validates and deploys to an integration sandbox, then to UAT in a partial or full-copy sandbox, and finally to production with the tests for the release.
Mention what you personally did: wrote the pipeline, fixed deployment errors, or ran the release.
Common mistake: Describing an ideal process you have never used. Interviewers will ask one follow-up question about it, and it shows.
12Right after a release, users cannot save Opportunities. What do you do in the first hour?
Right after a release, users cannot save Opportunities. What do you do in the first hour?
What the interviewer is checking: Calm prioritisation. Restoring service first and finding the root cause second is the order they want.
- Read the exact error from a user or the logs, and check whether it affects everyone or one profile, record type or region.
- Tell the users and the support lead that you are on it, with a time for the next update.
- Find which change caused it. Compare against the release contents: a new validation rule, trigger, flow or required field are the usual suspects.
- Choose the fastest safe fix: turn off the new flow or validation rule, use the trigger's bypass switch, or roll back the component. Fix the root cause properly afterwards.
- Confirm users can save, then write a short summary of the cause and what will stop it recurring, such as a missing test case.
Working with people
13The business wants a feature by Friday, and you think it needs two weeks. What do you do?
The business wants a feature by Friday, and you think it needs two weeks. What do you do?
I explain where the time goes, briefly and in business terms, and offer options instead of a no: a smaller version by Friday that covers the most important case, the full version in two weeks, or Friday with a known risk that I write down. Then the business owner chooses, and I confirm the choice in writing.
14How do you help a newer developer on your team?
How do you help a newer developer on your team?
Pair with them on their first tasks, explain why the team's patterns exist rather than only how to follow them, and review their code with specific, kind comments. I also give them a small piece of work they own completely, because ownership is how people learn fastest. If the team lacks documentation for something they ask, I write it down so the next person benefits.
AI and what you are learning
15How would you use Prompt Builder or Agentforce in a project you know?
How would you use Prompt Builder or Agentforce in a project you know?
Choose a real, small use case from your work. For example: a prompt template that drafts a follow-up email for an opportunity, grounded in the opportunity fields and recent activities, which the rep reviews before sending. Mention the safeguards: only the fields the prompt needs, the Einstein Trust Layer handling masking and data retention, and a person checking the output before it reaches a customer. Then say how you would measure whether it helps, such as time saved per email.
16Where do you want to be in two years?
Where do you want to be in two years?
Give a direction that fits the role, such as technical lead, solution architect or a specialist in a cloud, and what you are doing towards it: a certification you are working on, design work you have started taking on, or mentoring. Interviewers at this level are checking that you are growing towards more responsibility and that the role helps you get there.
How to prepare
- Choose three projects and practise telling each in two minutes: the problem, your decisions, the result.
- Revise the basics you will be asked to go deeper on: triggers and async Apex, LWC communication, sharing, Flow and integrations.
- Be ready to write a bulk-safe trigger and its test class on a shared screen.
- Do a timed mock interview and listen to how long your answers are. Two minutes is about right for most questions.