Q1. What is the difference between Workflow, Process Builder, and Flow?
π Workflow β Limited automation (field updates, email). Deprecated.
π Process Builder β More powerful, but also deprecated.
π Flow β Future of automation, supports before/after save, callouts, subflows.
Q2. What is Governor Limits in Salesforce?
π Salesforce enforces limits like SOQL queries (100 per transaction), DML statements (150 per transaction), heap size, CPU time, etc., to ensure multi-tenancy.
Q3. How do you prevent recursion in a Trigger?
π Use a static Boolean flag in a helper class. Example:
public class TriggerHandler {
public static Boolean isFirstRun = true;
}
Q4. Difference between Role and Profile?
π Profile β Object/field level permissions.
π Role β Data visibility through hierarchy.
Q5. What are setup vs non-setup objects?
π Setup: User, Profile.
π Non-setup: Account, Contact.
π Mixing them in the same transaction causes Mix DML error.
Q6. What are the different types of Flows?
π Screen Flow, Record-Triggered Flow (Before/After), Scheduled Flow, Autolaunched Flow.
Q7. Difference between Standard and Custom Object?
π Standard β Predefined by Salesforce (Account, Opportunity).
π Custom β Created by developers.
Q8. Explain Relationship types in Salesforce.
π Lookup, Master-Detail, Many-to-Many (via junction object).
Q9. What is the difference between SOQL and SOSL?
π SOQL β Structured query on one object at a time.
π SOSL β Full-text search across multiple objects.
Q10. What are Governor Limit best practices?
π Use bulkified code, avoid SOQL/DML inside loops, use maps/sets, prefer @future/Queueable for async processing.
Q11. What is a Trigger in Salesforce?
π Apex code that executes before/after DML operations.
Q12. How to handle bulk inserts in a Trigger?
π Always bulkify with Collections (List, Map, Set).
Q13. Real-time Scenario: You need to stop deleting Accounts if related Opportunities exist.
π Use before delete
trigger with a query on Opportunity.
Q14. How do you handle recursion in Triggers?
π Use static variable in handler class.
Q15. Difference between before and after trigger?
π Before β Modify values before saving (validation, default values).
π After β Work with committed record (callouts, DML on related objects).
Q16. Can we call a future method from a Batch?
π No, but you can call Queueable from Batch.
Q17. How do you write a test class for Triggers?
π Create test data, insert/update records, use Test.startTest()
and Test.stopTest()
.
Q18. What is a context variable in Triggers?
π Examples: Trigger.isInsert
, Trigger.isUpdate
, Trigger.isDelete
, Trigger.new
, Trigger.old
.
Q19. How do you design a Trigger framework?
π One trigger per object β Call Handler class β Manage events separately (beforeInsert, afterUpdate).
Q20. Real-time Scenario: You have to update Contact email if related Account email changes.
π Use after update
trigger on Account.
Q21. What is a SOQL Injection? How do you prevent it?
π Similar to SQL injection β malicious query input.
π Fix β Use bind variables or escapeSingleQuotes.
Q22. Difference between Relationship Query (Parent-to-Child vs Child-to-Parent)?
π Parent-to-Child β Subquery with relationship name.
π Child-to-Parent β Dot notation.
Q23. How to fetch all Accounts with related Contacts using SOQL?
π SELECT Id, Name, (SELECT Id, LastName FROM Contacts) FROM Account
Q24. Difference between COUNT() and COUNT_FIELD()?
π COUNT() β Count all rows.
π COUNT(Field) β Count rows where field is not null.
Q25. How do you write efficient SOQL queries?
π Use selective filters, avoid nested loops, use indexed fields.
Q26. Explain FOR UPDATE in SOQL.
π Locks records to prevent other transactions from updating.
Q27. What are Aggregate Queries?
π Queries with COUNT, SUM, AVG, MAX, MIN, GROUP BY, HAVING
.
Q28. Real Scenario: Get number of Opportunities by StageName.
π SELECT StageName, COUNT(Id) FROM Opportunity GROUP BY StageName
Q29. What are Skinny Tables?
π Custom tables managed by Salesforce to improve query performance.
Q30. Difference between Database.insert and insert?
π Database.insert
β Returns saveResult, can do partial insert with allOrNone=false
.
π insert
β All or none.
Q31. Difference between LWC and Aura?
π LWC β Web standards, better performance, reusable, less boilerplate.
π Aura β Legacy, slower, more code.
Q32. What are decorators in LWC?
π @api
β Expose property to parent.
π @track
β Reactive state.
π @wire
β Call Salesforce data.
Q33. Parent-to-Child communication in LWC?
π Use @api
properties.
Q34. Child-to-Parent communication in LWC?
π Use custom events with dispatchEvent()
.
Q35. Difference between @wire and imperative Apex?
π @wire β Reactive, cacheable, auto refresh.
π Imperative β Manual, dynamic, supports DML/callouts.
Q36. Real-time Scenario: You need to fetch Account list on button click.
π Use imperative Apex call.
Q37. How do you handle LDS in LWC?
π Use lightning-record-form
, lightning-record-view-form
, lightning-record-edit-form
.
Q38. What are lifecycle hooks in LWC?
π connectedCallback
, renderedCallback
, disconnectedCallback
.
Q39. How do you import Apex method in LWC?
π import getAccounts from '@salesforce/apex/AccountController.getAccounts';
Q40. Real-time Scenario: File Upload in LWC
π Use <lightning-file-upload>
with Apex for metadata storage.
Q41. Difference between Future, Batch, Queueable, and Scheduled Apex?
π Future β For simple async (like callouts).
π Batch β For large data.
π Queueable β Chain jobs, complex logic.
π Scheduled β Run at specific time.
Q42. Can we call Queueable from Batch?
π Yes.
Q43. Real-time Scenario: Process 5 million records. Which async to choose?
π Batch Apex.
Q44. How do you make a Callout from Apex?
π Use HttpRequest
& HttpResponse
. Must enable Remote Site Settings / Named Credentials.
Q45. What is Continuation in Apex?
π Used for long-running callouts to avoid hitting limits.
Q46. Difference between REST and SOAP integration in Salesforce?
π REST β Lightweight, JSON, simple.
π SOAP β XML, more secure, strict contract.
Q47. How to expose Salesforce data as REST API?
π Annotate Apex with @RestResource
and @HttpGet/Post
.
Q48. What are Platform Events?
π Pub-Sub model, used for event-driven architecture.
Q49. Real-time Scenario: Send notification when an Opportunity is Closed Won.
π Publish Platform Event in Apex, subscribe in LWC/Flow.
Q50. Best Practices for Integration in Salesforce?
π Use Named Credentials, limit callouts, handle retries, use Queueable for async.
These 50 Salesforce Developer Interview Questions cover Admin, Apex, LWC, SOQL, Triggers, Flows, and Integration β the most frequently asked topics in 2025 interviews.
π Bookmark this page and practice these Q&A daily.
π Focus more on real-world scenarios than just definitions β because thatβs what recruiters actually test.
Here are some resources to go deeper:
π 100 Scenarios (1β4 YOE)
π 100 Scenarios (4β8 YOE)
π LWC Q&A (Real Answers Explained)
π 600+ Qs from Recruiter Calls
π TCS, Infosys, EY Interview Qs
π Salesforce Project β Hindi + English