Salesforce Platform Developer II Exam
Verified Questions, Correct Answers, and
Detailed Explanations for Computer Science
Students||Already Graded A+
1. Which design pattern is most appropriate when you need to
separate read and write logic in a complex domain model?
A. Singleton
B. Decorator
C. CQRS
D. Factory
Answer: C
CQRS separates read and write responsibilities, improving scalability
and clarity.
2. Which Apex feature allows you to execute logic after a long-
running callout finishes asynchronously?
A. Future method
B. Queueable
C. Continuation
D. Batch Apex
Answer: C
Continuation is designed for long-running callouts and maintains user
session continuity.
3. What is the maximum number of callouts allowed in a single
Apex transaction?
A. 20
B. 50
,C. 100
D. Unlimited
Answer: C
Apex allows up to 100 callouts per transaction.
4. How should a developer avoid hitting CPU time limits in a
complex trigger?
A. Use multiple nested loops
B. Move logic to asynchronous processing
C. Add try/catch blocks
D. Use static variables
Answer: B
Asynchronous execution moves work outside the synchronous CPU
limits.
5. What is the primary benefit of using the Strategy design pattern
in Apex?
A. Reduces database queries
B. Allows interchangeable algorithms at runtime
C. Prevents recursion
D. Automates test creation
Answer: B
Strategy encapsulates interchangeable algorithms behind a common
interface.
6. What is the recommended way to share Apex code across
multiple Lightning Web Components?
A. Inline Apex
B. @AuraEnabled Apex service classes
, C. Duplicate the logic in each component
D. Give components direct access to triggers
Answer: B
LWCs interact with shared logic through @AuraEnabled Apex service
classes.
7. Which Apex primitive is not considered serializable for
Queueable?
A. String
B. Boolean
C. Database.QueryLocator
D. Integer
Answer: C
QueryLocator isn’t serializable and cannot be passed to Queueable.
8. To prevent SOQL injection for dynamic queries, what should a
developer use?
A. EscapeSingleQuotes()
B. Type casting
C. Bind variables
D. regular expressions
Answer: C
Bind variables are the most secure option against SOQL injection.
9. How many batch executions can run per 24 hours per org?
A. 250
B. 250,000
C. 1,000
D. Unlimited
Verified Questions, Correct Answers, and
Detailed Explanations for Computer Science
Students||Already Graded A+
1. Which design pattern is most appropriate when you need to
separate read and write logic in a complex domain model?
A. Singleton
B. Decorator
C. CQRS
D. Factory
Answer: C
CQRS separates read and write responsibilities, improving scalability
and clarity.
2. Which Apex feature allows you to execute logic after a long-
running callout finishes asynchronously?
A. Future method
B. Queueable
C. Continuation
D. Batch Apex
Answer: C
Continuation is designed for long-running callouts and maintains user
session continuity.
3. What is the maximum number of callouts allowed in a single
Apex transaction?
A. 20
B. 50
,C. 100
D. Unlimited
Answer: C
Apex allows up to 100 callouts per transaction.
4. How should a developer avoid hitting CPU time limits in a
complex trigger?
A. Use multiple nested loops
B. Move logic to asynchronous processing
C. Add try/catch blocks
D. Use static variables
Answer: B
Asynchronous execution moves work outside the synchronous CPU
limits.
5. What is the primary benefit of using the Strategy design pattern
in Apex?
A. Reduces database queries
B. Allows interchangeable algorithms at runtime
C. Prevents recursion
D. Automates test creation
Answer: B
Strategy encapsulates interchangeable algorithms behind a common
interface.
6. What is the recommended way to share Apex code across
multiple Lightning Web Components?
A. Inline Apex
B. @AuraEnabled Apex service classes
, C. Duplicate the logic in each component
D. Give components direct access to triggers
Answer: B
LWCs interact with shared logic through @AuraEnabled Apex service
classes.
7. Which Apex primitive is not considered serializable for
Queueable?
A. String
B. Boolean
C. Database.QueryLocator
D. Integer
Answer: C
QueryLocator isn’t serializable and cannot be passed to Queueable.
8. To prevent SOQL injection for dynamic queries, what should a
developer use?
A. EscapeSingleQuotes()
B. Type casting
C. Bind variables
D. regular expressions
Answer: C
Bind variables are the most secure option against SOQL injection.
9. How many batch executions can run per 24 hours per org?
A. 250
B. 250,000
C. 1,000
D. Unlimited