1️⃣ What is the difference between Workflow, Process Builder, and Flow?
Answer:
Workflow: Old automation tool, supports only field updates & email alerts. (Now deprecated)
Process Builder: More powerful (multi-step automation), but also deprecated.
Flow: The future of automation – supports before/after save triggers, screen flows, callouts, subflows, etc.
💡 Tip: Always say you prefer Flow in new projects since Salesforce announced Workflow & Process Builder retirement.
2️⃣ How do you prevent recursion in Apex triggers?
Answer: Use a static Boolean variable in a helper class. Example:
public class TriggerHandler {
private static Boolean runOnce = true;
public static void handleTrigger(List<Account> accounts) {
if(!runOnce) return;
runOnce = false;
// business logic here
}
}
💡 Tip: Interviewers want to see if you understand best practices in trigger frameworks.
3️⃣ Explain @wire vs imperative Apex in LWC.
Answer:
@wire: Reactive, automatically refreshes when data changes. Best for read-only fetches.
Imperative: Manual call. Best for conditional logic, DML, callouts.
4️⃣ What is a Mix DML error and how to handle it?
Answer: Occurs when setup & non-setup objects (e.g., User + Account) are modified in the same transaction. ✅ Fix: Move one DML into @future or Queueable Apex.
5️⃣ Difference between SOQL and SOSL?
SOQL: Query specific objects/fields, returns structured results. SOSL: Full-text search across multiple objects, returns records from different objects.
6️⃣ Future vs Batch vs Queueable vs Scheduled Apex
Trigger.isInsert, isUpdate, isDelete, isBefore, isAfter, etc.
1️⃣4️⃣ Explain @AuraEnabled annotation
Makes Apex accessible from LWC/Aura.
@AuraEnabled(cacheable=true) → best for read-only methods.
Without cache → for DML operations.
1️⃣5️⃣ How to schedule a batch job daily at 2 AM?
System.schedule('Daily Batch', '0 0 2 * * ?', new MyBatchClass());
1️⃣6️⃣ What are Governor Limits?
Salesforce’s way to protect multi-tenant environment:
SOQL: 100 queries
DML: 150 statements
CPU: 10 seconds
Heap size, etc.
💡 Tip: Always mention “Bulkification & best practices help avoid hitting limits.”
1️⃣7️⃣ SOQL for parent-child relationship
Parent → Child:
SELECT Name, (SELECT LastName FROM Contacts) FROM Account
Child → Parent:
SELECT Id, Account.Name FROM Contact
1️⃣8️⃣ What is a Wrapper Class?
A custom class to wrap multiple fields/objects into a single structure. ✅ Used in batch processing, LWC, VF tables, checkboxes.
1️⃣9️⃣ Salesforce Order of Execution
Validation → Before Triggers → Custom Validation → After Triggers → Assignment Rules → Workflow → Process Builder → Flow → Commit.
2️⃣0️⃣ Explain Continuous Integration (CI) in Salesforce
CI automates builds & deployments using GitHub, Jenkins, Bitbucket, or Copado. Ensures code quality, collaboration, and faster releases.
🔑 Final Takeaway
👉 If you can confidently answer these 20 Salesforce interview questions with examples and code, you’ll stand out in interviews. 👉 Don’t just memorize definitions – explain scenarios where you’d use Flow, Apex, LWC, or integrations.
🔥 Want 500+ Real Salesforce Questions & Notes? Check out my curated interview packs 👉 TrailheadTitansHub.com