Salesforce Platform Developer I Exam
Verified Questions, Correct Answers, and
Detailed Explanations for Computer Science
Students||Already Graded A+
1. Which data type is used to store a large block of text in
Salesforce?
A. Text
B. Long Text Area
C. Text Area (255)
D. Rich Text Area
Answer: B. Long Text Area
Rationale: Long Text Area can store up to 131,072 characters,
suitable for large text blocks. Text Area (255) stores only up to 255
characters, and Rich Text Area supports formatting but has limits.
2. Which of the following is a valid trigger event in Salesforce?
A. Before Update
B. After Delete
C. Before Insert
D. All of the above
Answer: D. All of the above
Rationale: Triggers can run before or after insert, update, delete, and
undelete events.
3. What is the maximum number of master-detail relationships you
can create on a custom object?
,A. 1
B. 2
C. 3
D. 5
Answer: B. 2
Rationale: A custom object can have up to 2 master-detail
relationships.
4. Which method in Apex is used to prevent recursive triggers?
A. @future
B. Trigger.new
C. Static Boolean Flag
D. Database.insert
Answer: C. Static Boolean Flag
Rationale: Static variables maintain their state throughout a
transaction and are commonly used to prevent recursion in triggers.
5. Which Salesforce feature allows automatic execution of Apex
code asynchronously?
A. Apex Triggers
B. Batch Apex
C. Visualforce
D. Validation Rules
Answer: B. Batch Apex
Rationale: Batch Apex allows processing of large volumes of data
asynchronously, breaking them into manageable batches.
6. Which SOQL function returns the number of rows in a query?
,A. COUNT()
B. SUM()
C. AVG()
D. MAX()
Answer: A. COUNT()
Rationale: COUNT() in SOQL returns the total number of records that
match the query criteria.
7. What is the maximum number of records that can be processed
in a single batch in Batch Apex?
A. 50
B. 200
C. 1,000
D. 10,000
Answer: B. 200
Rationale: By default, the batch size in Batch Apex is 200 records per
execution, though it can be customized.
8. Which statement about Salesforce governor limits is true?
A. They only apply to triggers
B. They are per transaction
C. They can be ignored in Batch Apex
D. They only affect SOQL queries
Answer: B. They are per transaction
Rationale: Governor limits enforce limits per transaction to ensure
efficient resource usage in Salesforce.
9. What is the main difference between a Lookup and a Master-
Detail relationship?
, A. Lookup allows sharing; Master-Detail does not
B. Master-Detail allows cascade delete; Lookup does not
C. Lookup can be optional; Master-Detail is always required
D. All of the above
Answer: D. All of the above
Rationale: Master-Detail relationships enforce ownership and
cascade delete, while Lookup relationships are more flexible.
10. Which annotation is used to expose an Apex class as a REST web
service?
A. @AuraEnabled
B. @RestResource
C. @InvocableMethod
D. @Future
Answer: B. @RestResource
Rationale: @RestResource annotation exposes an Apex class as a
RESTful web service endpoint.
11. Which Apex method is used to perform DML operations safely
to avoid partial failures?
A. Database.insert(records)
B. insert records
C. System.debug(records)
D. Database.execute(records)
Answer: A. Database.insert(records)
Rationale: Database methods allow optional parameters like
allOrNone=false to prevent all records from rolling back on error.
12. Which of the following is true about Visualforce controllers?
Verified Questions, Correct Answers, and
Detailed Explanations for Computer Science
Students||Already Graded A+
1. Which data type is used to store a large block of text in
Salesforce?
A. Text
B. Long Text Area
C. Text Area (255)
D. Rich Text Area
Answer: B. Long Text Area
Rationale: Long Text Area can store up to 131,072 characters,
suitable for large text blocks. Text Area (255) stores only up to 255
characters, and Rich Text Area supports formatting but has limits.
2. Which of the following is a valid trigger event in Salesforce?
A. Before Update
B. After Delete
C. Before Insert
D. All of the above
Answer: D. All of the above
Rationale: Triggers can run before or after insert, update, delete, and
undelete events.
3. What is the maximum number of master-detail relationships you
can create on a custom object?
,A. 1
B. 2
C. 3
D. 5
Answer: B. 2
Rationale: A custom object can have up to 2 master-detail
relationships.
4. Which method in Apex is used to prevent recursive triggers?
A. @future
B. Trigger.new
C. Static Boolean Flag
D. Database.insert
Answer: C. Static Boolean Flag
Rationale: Static variables maintain their state throughout a
transaction and are commonly used to prevent recursion in triggers.
5. Which Salesforce feature allows automatic execution of Apex
code asynchronously?
A. Apex Triggers
B. Batch Apex
C. Visualforce
D. Validation Rules
Answer: B. Batch Apex
Rationale: Batch Apex allows processing of large volumes of data
asynchronously, breaking them into manageable batches.
6. Which SOQL function returns the number of rows in a query?
,A. COUNT()
B. SUM()
C. AVG()
D. MAX()
Answer: A. COUNT()
Rationale: COUNT() in SOQL returns the total number of records that
match the query criteria.
7. What is the maximum number of records that can be processed
in a single batch in Batch Apex?
A. 50
B. 200
C. 1,000
D. 10,000
Answer: B. 200
Rationale: By default, the batch size in Batch Apex is 200 records per
execution, though it can be customized.
8. Which statement about Salesforce governor limits is true?
A. They only apply to triggers
B. They are per transaction
C. They can be ignored in Batch Apex
D. They only affect SOQL queries
Answer: B. They are per transaction
Rationale: Governor limits enforce limits per transaction to ensure
efficient resource usage in Salesforce.
9. What is the main difference between a Lookup and a Master-
Detail relationship?
, A. Lookup allows sharing; Master-Detail does not
B. Master-Detail allows cascade delete; Lookup does not
C. Lookup can be optional; Master-Detail is always required
D. All of the above
Answer: D. All of the above
Rationale: Master-Detail relationships enforce ownership and
cascade delete, while Lookup relationships are more flexible.
10. Which annotation is used to expose an Apex class as a REST web
service?
A. @AuraEnabled
B. @RestResource
C. @InvocableMethod
D. @Future
Answer: B. @RestResource
Rationale: @RestResource annotation exposes an Apex class as a
RESTful web service endpoint.
11. Which Apex method is used to perform DML operations safely
to avoid partial failures?
A. Database.insert(records)
B. insert records
C. System.debug(records)
D. Database.execute(records)
Answer: A. Database.insert(records)
Rationale: Database methods allow optional parameters like
allOrNone=false to prevent all records from rolling back on error.
12. Which of the following is true about Visualforce controllers?