Salesforce

Salesforce interview questions and answers

Salesforce roles are common across Indian IT services, and the interviews test two different skill sets. Admins get asked about configuration, security and automation. Developers get asked about Apex, triggers and governor limits. Most rounds start with a scenario from your own project, so be ready to explain how your org was set up.

Asked of: Salesforce developer, admin and consultant roles. Every answer below describes what a strong response covers rather than a script to memorise, because the follow-up question is where these rounds are actually decided.

What gets tested
01

Data model and security

Standard and custom objects, lookup and master-detail relationships, profiles, permission sets, roles and sharing rules. Know which one controls what.

02

Automation

Flows, validation rules and approval processes, and when you'd reach for Apex. Workflow rules and Process Builder are being retired, so talk about Flow.

03

Apex and triggers

Trigger context variables, bulkification, one trigger per object, and handler classes. Expect to write a small trigger on the spot.

04

Governor limits and async Apex

SOQL and DML limits per transaction, and when to use future methods, Queueable, Batch Apex or scheduled jobs.

05

Lightning Web Components and integration

LWC basics, wired versus imperative Apex calls, and REST callouts with named credentials.

For freshers

Salesforce interview questions for freshers

What is the difference between a lookup and a master-detail relationship?

Master-detail ties the child's ownership, sharing and deletion to the parent, and supports roll-up summary fields. A lookup is looser: the child can exist alone and keeps its own sharing. Give one example of each from a real org.

What is the difference between a profile and a permission set?

Every user has exactly one profile, which sets their base access. Permission sets add access on top for specific users. Mention that Salesforce's own guidance is moving towards minimal profiles, with access granted through permission sets.

What are governor limits and why do they exist?

Salesforce is multi-tenant, so each transaction gets fixed limits that stop one org's code from hogging shared resources. Quote two you know, such as 100 SOQL queries and 150 DML statements per synchronous transaction.

What is a validation rule? Give an example.

A formula that blocks a save when it evaluates to true, with an error message for the user. For example, stopping an Opportunity from moving to Closed Won without an amount.

What is the difference between SOQL and SOSL?

SOQL queries one object and its related records, much like a SQL SELECT. SOSL searches text across several objects at once. Use SOQL when you know the object and SOSL for a global search.

What are roll-up summary fields?

Fields on a master record that count, sum, or find the minimum or maximum of its child records. They need a master-detail relationship, which is the usual follow-up question.

When would you use a Flow instead of Apex?

Use Flow when the logic is declarative and an admin should be able to maintain it: field updates, record creation, simple screens. Move to Apex for complex logic, large data volumes or fine-grained error handling.

For experienced candidates

Salesforce interview questions for experienced candidates

How do you bulkify a trigger?

Never query or run DML inside a loop. Collect IDs into a set, query once, work with maps, and do one DML at the end. Then explain how you tested it with 200 records, which is the trigger batch size.

What's the difference between future methods, Queueable and Batch Apex?

Future methods are simple fire-and-forget calls that take primitive parameters. Queueable accepts objects, returns a job ID and can chain jobs. Batch Apex processes large data in chunks, with fresh limits for each chunk. Say which one you used and why.

How do you avoid recursion in triggers?

Use a static set of processed record IDs in a handler class, so the logic runs once per record per transaction. Mention that a trigger framework keeps this consistent across objects.

What is the order of execution when a record is saved?

Before-save flows and before triggers run first, then custom validation rules, then the record is saved, then after triggers, assignment and auto-response rules, after-save flows, and finally the commit. You don't need every step from memory, but the position of triggers and flows comes up often.

How do you write test classes for Apex?

Salesforce needs 75% code coverage to deploy to production, but the panel wants to hear about assertions. Create test data in the class, wrap the code under test in Test.startTest and Test.stopTest, and assert the outcome. Mention @testSetup for shared data.

How would you fix a 'Too many SOQL queries: 101' error?

Find the query inside a loop, usually in a trigger or a helper it calls, and move it out. Query once with the collected IDs and use a map. If several triggers fire in the same transaction, check all of them together.

How would you integrate Salesforce with an external system?

Start with the direction and the volume. Use REST callouts with named credentials for real-time needs, platform events or change data capture for event-driven updates, and the Bulk API for large loads. Pick one you've built and walk through how it handles errors.

What candidates get wrong here
  • Know your own org. Interviewers ask how many users it had, which clouds it used, such as Sales or Service Cloud, and which systems it integrated with.
  • Talk about Flow for new automation. Proposing a new Process Builder tells the panel your knowledge is a few releases old.
  • Mention the certifications you hold, like Administrator or Platform Developer I, and be ready for questions from their syllabus.
  • Practise writing a bulkified trigger by hand. It's a common live coding task in Salesforce developer rounds.

Answer them out loud before someone asks

Reading a question and answering it under a follow-up are different skills. Practise these against an AI interviewer that pushes back and scores your answer, or check your resume first with the free ATS resume checker.

Start My Free Mock Interview
Other skills