Technical Interview Strategy & Mock Questions

0/2 in this phase0/41 across the roadmap

📖 Concept

Salesforce interviews vary significantly by level. Understanding the format, expectations, and preparation strategy for each level is critical for career advancement.

Interview formats by level:

Developer (0-3 years):

Round 1: Technical screening (Apex basics, SOQL, triggers)
Round 2: Coding challenge (live coding or take-home)
Round 3: Platform knowledge (objects, security, Flows)
Round 4: Cultural fit / team match

Senior Developer (3-7 years):

Round 1: Deep technical (governor limits, async, performance)
Round 2: Architecture discussion (integration, LDV, multi-tenant)
Round 3: Code review exercise (review and improve existing code)
Round 4: System design (whiteboard solution for a business scenario)
Round 5: Leadership / behavioral

Technical Architect (7+ years):

Round 1: Architecture deep dive (multi-org, integration patterns)
Round 2: System design (enterprise-scale solution, 60 min)
Round 3: CTA-style scenario (mock CTA review board)
Round 4: Stakeholder management (communicate tech to non-tech)
Round 5: Executive presentation (defend architecture decisions)

Preparation strategy:

  1. Build projects — Nothing beats hands-on experience. Build 2-3 complete projects.
  2. Trailhead — Complete Superbadges (Apex Specialist, Data Integration, LWC)
  3. Certifications — Platform Developer I & II, Application Architect
  4. Practice — Explain concepts out loud (rubber duck technique)
  5. Mock interviews — Practice with peers or mentors
  6. System design — Practice designing systems on a whiteboard

Common interview themes:

  1. Governor limits and bulkification (asked at ALL levels)
  2. Security model (sharing, FLS, OWD)
  3. Integration patterns (REST, Platform Events, middleware)
  4. Trigger best practices (framework, recursion, order of execution)
  5. LWC lifecycle and communication patterns
  6. Performance optimization (LDV, query selectivity, caching)

💻 Code Example

codeTap to expand ⛶
1// Interview Coding Exercises
2
3// 1. CLASSIC: Write a bulkified trigger
4// Prompt: "Write a trigger that updates the Account's total revenue
5// when Opportunities are inserted or updated."
6
7trigger OpportunityTrigger on Opportunity (after insert, after update) {
8 // Collect affected Account IDs
9 Set<Id> accountIds = new Set<Id>();
10 for (Opportunity opp : Trigger.new) {
11 if (opp.AccountId != null) {
12 accountIds.add(opp.AccountId);
13 }
14 }
15 // Also check old values for reparented opps
16 if (Trigger.isUpdate) {
17 for (Opportunity opp : Trigger.old) {
18 if (opp.AccountId != null) {
19 accountIds.add(opp.AccountId);
20 }
21 }
22 }
23
24 if (accountIds.isEmpty()) return;
25
26 // Aggregate opportunity amounts per account
27 Map<Id, Decimal> revenueByAccount = new Map<Id, Decimal>();
28 for (AggregateResult ar : [
29 SELECT AccountId, SUM(Amount) totalAmount
30 FROM Opportunity
31 WHERE AccountId IN :accountIds
32 AND StageName = 'Closed Won'
33 GROUP BY AccountId
34 ]) {
35 revenueByAccount.put(
36 (Id) ar.get('AccountId'),
37 (Decimal) ar.get('totalAmount')
38 );
39 }
40
41 // Update accounts
42 List<Account> accountsToUpdate = new List<Account>();
43 for (Id accId : accountIds) {
44 accountsToUpdate.add(new Account(
45 Id = accId,
46 Total_Revenue__c = revenueByAccount.containsKey(accId)
47 ? revenueByAccount.get(accId) : 0
48 ));
49 }
50 update accountsToUpdate;
51}
52
53// 2. CODE REVIEW: Find and fix all issues in this code
54// Prompt: "Review this code and identify all problems"
55
56/*
57 BUGGY CODE (find the issues):
58
59 trigger CaseTrigger on Case (after insert) {
60 for (Case c : Trigger.new) {
61 Account acc = [SELECT Id, Name FROM Account WHERE Id = :c.AccountId];
62 c.Description = 'Account: ' + acc.Name;
63 update c;
64
65 EmailService.sendEmail(c.ContactEmail, 'Case Created', c.Subject);
66
67 Task t = new Task();
68 t.WhatId = c.Id;
69 t.Subject = 'Follow up';
70 insert t;
71 }
72 }
73
74 ISSUES:
75 1. SOQL inside loop — will fail at 101 records
76 2. DML inside loop (update c) — will fail at 151 records
77 3. Cannot modify Trigger.new in after trigger (read-only)
78 4. DML inside loop (insert t) — another DML per iteration
79 5. Email in loop — will hit email invocation limit
80 6. No null check on AccountId
81 7. No error handling
82 8. Single trigger, should use handler pattern
83*/
84
85// FIXED VERSION:
86public class CaseTriggerHandler {
87
88 public static void handleAfterInsert(List<Case> cases) {
89 // Collect data
90 Set<Id> accountIds = new Set<Id>();
91 for (Case c : cases) {
92 if (c.AccountId != null) accountIds.add(c.AccountId);
93 }
94
95 // Query once
96 Map<Id, Account> accounts = new Map<Id, Account>(
97 [SELECT Id, Name FROM Account WHERE Id IN :accountIds]
98 );
99
100 // Process
101 List<Case> casesToUpdate = new List<Case>();
102 List<Task> tasksToCreate = new List<Task>();
103 List<Messaging.SingleEmailMessage> emails = new List<Messaging.SingleEmailMessage>();
104
105 for (Case c : cases) {
106 // Update case description
107 Account acc = accounts.get(c.AccountId);
108 if (acc != null) {
109 casesToUpdate.add(new Case(
110 Id = c.Id,
111 Description = 'Account: ' + acc.Name
112 ));
113 }
114
115 // Create follow-up task
116 tasksToCreate.add(new Task(
117 WhatId = c.Id,
118 Subject = 'Follow up on case: ' + c.CaseNumber,
119 ActivityDate = Date.today().addDays(1)
120 ));
121 }
122
123 // DML once each
124 if (!casesToUpdate.isEmpty()) update casesToUpdate;
125 if (!tasksToCreate.isEmpty()) insert tasksToCreate;
126 }
127}
128
129// 3. SYSTEM DESIGN: Design a Lead scoring system
130// Prompt: "Design a system that scores Leads based on behavior and demographics"
131
132public class LeadScoringEngine {
133
134 // Configuration-driven scoring via Custom Metadata
135 public static void scoreLeads(List<Lead> leads) {
136 // Load scoring rules from Custom Metadata
137 List<Lead_Score_Rule__mdt> rules = [
138 SELECT Category__c, Field_Name__c, Operator__c,
139 Value__c, Points__c
140 FROM Lead_Score_Rule__mdt
141 WHERE Is_Active__c = true
142 ];
143
144 for (Lead lead : leads) {
145 Integer score = 0;
146
147 for (Lead_Score_Rule__mdt rule : rules) {
148 if (evaluateRule(lead, rule)) {
149 score += (Integer) rule.Points__c;
150 }
151 }
152
153 lead.Lead_Score__c = score;
154 lead.Score_Grade__c = getGrade(score);
155 }
156 }
157
158 private static Boolean evaluateRule(Lead lead, Lead_Score_Rule__mdt rule) {
159 Object fieldValue = lead.get(rule.Field_Name__c);
160 if (fieldValue == null) return false;
161
162 String valueStr = String.valueOf(fieldValue);
163
164 switch on rule.Operator__c {
165 when 'equals' { return valueStr == rule.Value__c; }
166 when 'contains' { return valueStr.contains(rule.Value__c); }
167 when 'not_empty' { return String.isNotBlank(valueStr); }
168 when else { return false; }
169 }
170 }
171
172 private static String getGrade(Integer score) {
173 if (score >= 80) return 'A';
174 if (score >= 60) return 'B';
175 if (score >= 40) return 'C';
176 if (score >= 20) return 'D';
177 return 'F';
178 }
179}

🏋️ Practice Exercise

Interview Preparation Exercises:

  1. Practice explaining: "What happens when a user clicks Save on an Account?" (Order of Execution)
  2. Mock interview: Answer 10 Apex fundamentals questions in 20 minutes
  3. Code review exercise: Find and fix 10 bugs in a provided trigger
  4. System design exercise: Design a CRM system for a SaaS company on a whiteboard (45 min)
  5. Behavioral: Prepare STAR stories for 5 scenarios (disagreement, failure, leadership, deadline, learning)
  6. Live coding: Write a bulkified trigger with test class in 30 minutes
  7. Architecture: Present a multi-cloud solution proposal to a mock business audience
  8. Debug exercise: Given a debug log, identify the root cause of a governor limit exception
  9. Complete the Apex Specialist Superbadge on Trailhead
  10. Conduct a mock CTA review board with a peer (present architecture for a scenario)

⚠️ Common Mistakes

  • Jumping into coding without understanding the problem — always ask clarifying questions first. Interviewers evaluate your problem-solving approach

  • Not practicing out loud — knowing the answer in your head is different from articulating it clearly under interview pressure

  • Focusing only on coding — senior interviews are 50% architecture and communication. Practice system design and stakeholder communication

  • Not asking about requirements and constraints — in system design interviews, always ask about scale (users, data volume), performance requirements, and budget

  • Over-engineering interview answers — start simple, then add complexity. Show you understand the tradeoffs between simple and complex solutions

💼 Interview Questions

🎤 Mock Interview

Mock interview is powered by AI for Technical Interview Strategy & Mock Questions. Login to unlock this feature.