Docsity

Salesforce Certified Platform Developer I — Object-Oriented Apex Programming, Trigger Fra, Exams of Web Application Development

Toggle sidebar
bg1
Salesforce Certified Platform Developer I — Object-Oriented Apex
Programming, Trigger Frameworks, SOQL/SOSL & Governor Limits,
Lightning Web Components (LWC), Visualforce, Asynchronous Processing,
Automated Testing, Integration, Security & Salesforce DX Comprehensive
Practice Exam
Comprehensive 250-Question Assessment Bank | Batch 1 of 5 (Front Matter & Questions 1–50)
1. Exam Overview
Exam Title:
Salesforce Certified Platform Developer I — Object-Oriented Apex Programming,
Trigger Frameworks, SOQL/SOSL & Governor Limits, Lightning Web Components
(LWC), Visualforce, Asynchronous Processing, Automated Testing, Integration,
Security & Salesforce DX Comprehensive Practice Exam
Total Questions:
250 Multiple-Choice Questions (4 Options Each — Single Best Answer)
Delivery Structure:
5 Modular Batches of 50 Questions Each (Batch 1: Q1–Q50 | Batch 2: Q51–Q100 |
Batch 3: Q101–Q150 | Batch 4: Q151–Q200 | Batch 5: Q201–Q250)
Recommended Time Allocation:
375 Minutes total (1.5 minutes per question for full simulation, or 75 minutes per
50-question batch)
Passing Benchmark:
70% (175 / 250 correct responses)
Assessment Scope:
Evaluates programmatic architecture and hands-on development proficiency across
the Salesforce Lightning Platform, including Apex design patterns, bulkified triggers,
SOQL/SOSL query optimization, multi-tenant governor limits, LWC reactive
architecture, legacy Visualforce maintenance, asynchronous Apex, unit test
isolation, REST/SOAP integrations, platform security enforcement, and source-
driven Salesforce DX workflows.
2. Content Blueprint
Domain
Technical Area
Question
Range
Weight
Core Competencies Assessed
Domain 1
Apex Language Fundamentals
& OOP
Q1 – Q35
14%
Primitive/collection types, interfaces,
inheritance, virtual/abstract classes, exceptions,
Schema describe, custom metadata/settings
Domain 2
Apex Triggers & Order of
Execution
Q36 – Q70
14%
Trigger context variables, Save Order of
Execution, recursion control, trigger
frameworks, bulkification, Platform Events
Domain 3
SOQL, SOSL & Governor Limits
Q71 – Q105
14%
Relationship queries, aggregate functions, query
selectivity, SOQL-for-loops, multi-tenant limits,
DML & Database methods
Domain 4
Asynchronous Apex Processing
Q106 – Q130
10%
Future methods, Queueable Apex & chaining,
Batch Apex (Database.Batchable), Scheduled
Apex, Async limits & monitoring
Domain 5
Lightning Web Components
Q131 – Q170
16%
Component lifecycle hooks,
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28

Partial preview of the text

Download Salesforce Certified Platform Developer I — Object-Oriented Apex Programming, Trigger Fra and more Exams Web Application Development in PDF only on Docsity!

Salesforce Certified Platform Developer I — Object-Oriented Apex

Programming, Trigger Frameworks, SOQL/SOSL & Governor Limits,

Lightning Web Components (LWC), Visualforce, Asynchronous Processing,

Automated Testing, Integration, Security & Salesforce DX Comprehensive

Practice Exam

Comprehensive 250-Question Assessment Bank | Batch 1 of 5 (Front Matter & Questions 1–50)

1. Exam Overview

Exam Title: Salesforce Certified Platform Developer I — Object-Oriented Apex Programming, Trigger Frameworks, SOQL/SOSL & Governor Limits, Lightning Web Components (LWC), Visualforce, Asynchronous Processing, Automated Testing, Integration, Security & Salesforce DX Comprehensive Practice Exam Total Questions: 250 Multiple-Choice Questions (4 Options Each — Single Best Answer) Delivery Structure: 5 Modular Batches of 50 Questions Each (Batch 1: Q1–Q50 | Batch 2: Q51–Q100 | Batch 3: Q101–Q150 | Batch 4: Q151–Q200 | Batch 5: Q201–Q250) Recommended Time Allocation: 375 Minutes total (1.5 minutes per question for full simulation, or 75 minutes per 50 - question batch) Passing Benchmark: 70% (175 / 250 correct responses) Assessment Scope: Evaluates programmatic architecture and hands-on development proficiency across the Salesforce Lightning Platform, including Apex design patterns, bulkified triggers, SOQL/SOSL query optimization, multi-tenant governor limits, LWC reactive architecture, legacy Visualforce maintenance, asynchronous Apex, unit test isolation, REST/SOAP integrations, platform security enforcement, and source- driven Salesforce DX workflows.

2. Content Blueprint

Domain Technical Area Question Range Weight Core Competencies Assessed Domain 1 Apex Language Fundamentals & OOP Q1 – Q35 14% Primitive/collection types, interfaces, inheritance, virtual/abstract classes, exceptions, Schema describe, custom metadata/settings Domain 2 Apex Triggers & Order of Execution Q36 – Q70 14% Trigger context variables, Save Order of Execution, recursion control, trigger frameworks, bulkification, Platform Events Domain 3 SOQL, SOSL & Governor Limits Q71 – Q105 14% Relationship queries, aggregate functions, query selectivity, SOQL-for-loops, multi-tenant limits, DML & Database methods Domain 4 Asynchronous Apex Processing Q106 – Q130 10% Future methods, Queueable Apex & chaining, Batch Apex (Database.Batchable), Scheduled Apex, Async limits & monitoring Domain 5 Lightning Web Components Q131 – Q170 16% Component lifecycle hooks,

(LWC) @api/@track/@wire decorators, Lightning Data Service, pub-sub/LMS, imperative Apex, Shadow DOM Domain 6 Visualforce & Aura Interoperability Q171 – Q190 8% Standard/Custom/Extension controllers, View State optimization, actionFunction/actionPoller, Lightning Out, Aura-LWC interop Domain 7 Testing, Debugging & Performance Q191 – Q220 12% @isTest, @testSetup, Test.startTest/stopTest, System.runAs, HttpCalloutMock, Stub API, Developer Console & Log Inspector Domain 8 Integration, Security & Salesforce DX Q221 – Q250 12% REST/SOAP callouts, Named Credentials, with/without sharing, WITH USER_MODE, stripInaccessible, SFDX CLI, scratch orgs, unlocked packages

3. How to Use This Exam

  • Timed Exam Simulation: Complete one 50-question batch within 75 minutes without referencing Salesforce documentation or an IDE to simulate real certification pacing.
  • Active Rationale Review: After completing each batch, inspect the green-highlighted [CORRECT ANSWER] and read the italicized rationale for every question—including questions answered correctly—to master subtle platform edge cases.
  • Batch Consolidation in Word: Batches 2 through 5 are formatted as clean, questions-only continuation files. You can merge all five .docx files into a single master workbook using Word's Insert - > Object - > Text from File feature.
  • Targeted Remediation: Map missed questions back to the Content Blueprint domains above to prioritize hands-on coding exercises in a Salesforce Developer Edition or Scratch Org.

4. Reference Materials

  • Salesforce Apex Developer Guide: Official documentation covering Apex syntax, object-oriented principles, triggers, governor limits, asynchronous Apex, and testing frameworks (developer.salesforce.com/docs/atlas.en- us.apexcode.meta).
  • Lightning Web Components Developer Guide: Official guide to LWC architecture, decorators, Lightning Data Service, event communication, and security (developer.salesforce.com/docs/platform/lwc).
  • SOQL and SOSL Reference: Comprehensive reference for query syntax, relationship traversal, aggregate queries, and query selectivity optimization.
  • Salesforce DX Developer Guide: Documentation for Salesforce CLI (sf), source-driven development, scratch org definitions, and package development lifecycles.
  • Trailhead Certification Preparation: Platform Developer I Trailmix and official Certification Exam Guide on Trailhead (trailhead.salesforce.com).

Question 5. A developer needs to design a base class PaymentProcessor that provides shared logging methods with full implementations, while forcing every subclass to implement its own processPayment(Decimal amount) method. Which class and method modifiers should be used? A) public virtual class PaymentProcessor with public virtual void processPayment(Decimal amount) B) [CORRECT ANSWER] public abstract class PaymentProcessor with public abstract void processPayment(Decimal amount); C) public interface PaymentProcessor with public virtual void processPayment(Decimal amount) D) public final class PaymentProcessor with public override void processPayment(Decimal amount) Rationale: An abstract class can contain both concrete implemented methods and abstract method signatures (with no body) that concrete subclasses must override. Question 6. Which keyword is required on a method in a virtual or abstract superclass to allow a subclass to provide a specialized implementation of that method? A) override B) [CORRECT ANSWER] virtual or abstract C) extends D) global Rationale: In Apex, methods are final by default. A superclass method must be explicitly marked virtual (if it has a body) or abstract (if it has no body) before a subclass can use the override keyword. Question 7. A developer defines an Apex interface named Discountable. Which access modifier is valid for methods declared inside Discountable? A) private B) protected C) [CORRECT ANSWER] No access modifier (implicitly public) D) static Rationale: Interface method signatures in Apex cannot specify access modifiers (public, private, protected, or global) or static; they are implicitly public to any implementing class. Question 8. Which exception type CANNOT be caught by a try-catch block in Apex? A) System.DmlException B) System.QueryException C) [CORRECT ANSWER] System.LimitException D) System.NullPointerException Rationale: System.LimitException (thrown when a governor limit is exceeded) cannot be caught by Apex try-catch blocks; execution halts immediately and all uncommitted database work is rolled back. Question 9. What is the purpose of the finally block in an Apex try-catch-finally construct? A) It executes only when an unhandled exception occurs. B) It executes only when no exception is thrown in the try block. C) [CORRECT ANSWER] It always executes after the try and catch blocks finish, regardless of whether an exception occurred (unless a LimitException is thrown). D) It automatically rolls back all DML operations performed inside the try block. Rationale: Code inside a finally block is guaranteed to execute upon exiting the try/catch structure whether an exception was thrown or not, making it ideal for resource cleanup.

Question 10. A developer needs to instantiate a generic sObject dynamically at runtime when only the API name string 'Custom_Invoice__c' is known, without using a SOQL query. Which approach consumes the least CPU time and avoids global describe overhead? A) Schema.getGlobalDescribe().get('Custom_Invoice__c').newSObject() B) [CORRECT ANSWER] ((sObject)Type.forName('Schema', 'Custom_Invoice__c').newInstance()) C) Database.query('SELECT Id FROM Custom_Invoice__c LIMIT 1') D) new sObject('Custom_Invoice__c') Rationale: Using Type.forName('Schema', objectName).newInstance() avoids loading the entire org's Schema.getGlobalDescribe() map into memory, significantly improving performance. Question 11. Which Schema method retrieves picklist values (labels and API values) for a specific field on an sObject? A) [CORRECT ANSWER] Schema.SObjectType.Account.fields.Industry.getDescribe().getPicklistValues() B) Schema.getGlobalDescribe().get('Account').getPicklist('Industry') C) Account.Industry.getValues() D) Database.getPicklistValues('Account', 'Industry') Rationale: Calling .getDescribe().getPicklistValues() on a Schema.SObjectField token returns a List containing label, value, and active status. Question 12. What is a key advantage of using Custom Metadata Types (__mdt) over List Custom Settings (__c) for storing application configuration rules? A) Custom Metadata Types can be modified directly via standard DML (insert/update) inside Apex triggers. B) [CORRECT ANSWER] Custom Metadata Type records are metadata — meaning they can be deployed via change sets/packages and are visible in Apex unit tests without SeeAllData=true. C) Custom Metadata Types do not count toward the 10 MB cached org data limit. D) Custom Metadata Types support Master-Detail relationships to standard Account records. Rationale: Because Custom Metadata Type records are metadata rather than data, they deploy seamlessly across environments and are automatically accessible in unit tests without needing SeeAllData=true or manual test record insertion. Question 13. How can a developer retrieve a single Custom Metadata Type record in Apex without consuming a SOQL query? A) [CORRECT ANSWER] My_Config__mdt.getInstance('Default_Rule') B) Database.fetchMetadata('My_Config__mdt', 'Default_Rule') C) Schema.getMetadata('My_Config__mdt.Default_Rule') D) My_Config__mdt.queryByDeveloperName('Default_Rule') Rationale: CustomMetadataType__mdt.getAll() and .getInstance(developerName) retrieve cached custom metadata records directly from the application cache without counting against SOQL query limits.

Question 19. Which operator in Apex compares two object references to verify whether they point to the exact same memory location rather than comparing structural value equality? A) == B) [CORRECT ANSWER] === C) .equals() D) != Rationale: In Apex, == invokes value equality (calling equals() on objects), whereas === checks strict reference identity (whether both variables reference the exact same object instance in memory). Question 20. When casting a generic sObject variable sobj into a concrete Contact variable, how should a developer safely verify the runtime type first to prevent a TypeException? A) [CORRECT ANSWER] if (sobj instanceof Contact) B) if (sobj typeof Contact) C) if (sobj.getType() == 'Contact') D) if (Contact.class.isInstance(sobj)) Rationale: The instanceof keyword checks at runtime whether an object reference is an instance of the specified type (or subtype) before safely casting. Question 21. What is the maximum number of elements that can be stored in an Apex List, Set, or Map? A) 10,000 elements B) 50,000 elements C) [CORRECT ANSWER] Limited only by the available Apex heap size (6 MB synchronous / 12 MB asynchronous) D) 2,000 elements Rationale: Apex collections have no fixed element-count cap; their size is constrained solely by the transaction's maximum heap size limit (6 MB synchronous, 12 MB asynchronous). Question 22. Which method on the Database class allows a developer to roll back the database state to an earlier point within the same Apex transaction without terminating execution? A) Database.undo(txId) B) [CORRECT ANSWER] Savepoint sp = Database.setSavepoint(); ... Database.rollback(sp); C) System.rollbackTransaction(); D) Database.revertDml(sp); Rationale: Database.setSavepoint() creates a transaction savepoint, and Database.rollback(sp) reverts all DML performed after that savepoint while allowing execution to continue. Question 23. If a developer creates a Savepoint, executes DML, rolls back to that Savepoint, and then attempts to roll back to an earlier Savepoint created before the first one, what happens? A) Both rollbacks succeed cleanly. B) A System.DmlException is thrown because savepoints created after a rollback target become invalid, though rolling back to an earlier savepoint invalidates any subsequent savepoints. C) [CORRECT ANSWER] Rolling back to an earlier savepoint succeeds and invalidates all savepoints generated after it. D) Savepoints cannot be nested in Apex. Rationale: Rolling back to an earlier savepoint is valid, and doing so automatically invalidates any savepoints that were created chronologically after that savepoint.

Question 24. Which annotation exposes a static Apex method so that it can be invoked as a declarative Action inside Salesforce Flow Builder? A) @AuraEnabled B) [CORRECT ANSWER] @InvocableMethod C) @FlowAction D) @RemoteAction Rationale: @InvocableMethod makes a static Apex method discoverable and executable as an Apex Action element in Flow Builder (and Einstein Bots). Question 25. What is a mandatory structural requirement for any method annotated with @InvocableMethod? A) It must accept zero parameters. B) [CORRECT ANSWER] Both its input parameter (if present) and return type (if non-void) must be a List (e.g., List or List). C) It must be declared inside a global class. D) It must perform no DML operations. Rationale: To support Flow bulkification, @InvocableMethod signatures must accept a List as input and return a List of matching size (or void). Question 26. Which annotation allows an Apex class or method to be serialized into JSON even when it contains private member variables, or prevents a specific transient field from being serialized? A) [CORRECT ANSWER] @JsonAccess on classes and the transient keyword on fields B) @Serializable on classes and @Ignore on fields C) @RestResource on classes and @Hidden on fields D) @AuraEnabled on classes and static on fields Rationale: @JsonAccess(serializable='always' deserializable='always') controls cross-namespace JSON serialization access, and marking a variable transient excludes it from JSON.serialize() and Visualforce View State. Question 27. What happens when JSON.deserialize(jsonString, Account.class) encounters a JSON property name that does not exist as a field on the Account sObject? A) It silently ignores the unknown property. B) [CORRECT ANSWER] It throws a System.JSONException. C) It stores the unknown property in a Map on the sObject. D) It returns null. Rationale: JSON.deserialize strictly validates keys against the target type's fields/properties and throws a System.JSONException if an unrecognized field is present (unlike JSON.deserializeUntyped). Question 28. Which Date or Datetime method returns the current user's local date based on their Salesforce user profile time zone rather than UTC/GMT? A) Datetime.now().dateGmt() B) [CORRECT ANSWER] Date.today() C) System.utcToday() D) Datetime.getLocalDate() Rationale: Date.today() returns the current date in the context user's configured time zone, whereas Datetime.now().dateGmt() returns the GMT date.

Question 34. Which UserInfo method returns the Salesforce Id of the user currently executing the Apex transaction? A) [CORRECT ANSWER] UserInfo.getUserId() B) UserInfo.getCurrentUser().Id C) System.currentUserId() D) Database.getSessionUserId() Rationale: UserInfo.getUserId() returns the 18-character Id of the running context user without requiring a SOQL query on the User object. Question 35. What happens if an Apex enum value is converted to a String using .name()? A) It returns the integer ordinal index of the enum constant. B) [CORRECT ANSWER] It returns the exact identifier name of the enum constant as a String. C) It throws a TypeException. D) It returns the namespace prefix of the class. Rationale: enumValue.name() returns the exact declared string identifier of the enum constant, while .ordinal() returns its zero-based position. Question 36. In the Salesforce Order of Execution, when do Before Triggers execute relative to System Validation Rules (such as required field checks and field format validation)? A) After system validation rules and after custom validation rules B) [CORRECT ANSWER] Before system validation rules (except layout-level required checks on standard UI saves), followed by system and custom validation rules C) After record save to the database D) After Workflow Rules and Record-Triggered Flows Rationale: In the Salesforce Save Order of Execution, Before Triggers run before system and custom validation rules, allowing triggers to populate or normalize fields prior to validation. Question 37. Which DML operation does NOT fire before update or after update triggers on the parent record when child records are reparented? A) Updating a lookup field on a child record B) A merge operation on duplicate Account records (which fires delete triggers on losing records and update triggers on the winning record) C) [CORRECT ANSWER] Cascading deletion of child records in a Master-Detail relationship (delete triggers do NOT fire on cascade-deleted children) D) Upserting an existing Contact record Rationale: When a Master-Detail parent record is deleted, its child records are cascade-deleted by the platform without firing before delete or after delete triggers on the child object.

Question 38. Which trigger context variable is populated ONLY in after insert, after update, and after undelete triggers, and is null in before insert triggers? A) Trigger.new B) [CORRECT ANSWER] Trigger.newMap C) Trigger.old D) Trigger.size Rationale: Trigger.newMap (Map) requires record IDs as map keys; since records do not yet have IDs in before insert, Trigger.newMap is null in before insert. Question 39. Why are Trigger.new records read-only in an after update trigger, throwing a System.FinalException: Record is read-only if modified directly? A) Because after triggers execute in a separate asynchronous thread. B) [CORRECT ANSWER] Because records in after triggers have already been written to the database; modifying them requires an explicit DML update on a separate instance or list. C) Because Trigger.new is always immutable in all trigger events. D) Because after triggers run before validation rules. Rationale: In after triggers, the record has already been saved to the database (and its Id and system fields are set), so Trigger.new is locked as read-only. To update fields on the same record, you must instantiate a new sObject with that Id and perform DML update. Question 40. In an after update trigger on Account, a developer wants to check whether the Industry field actually changed on each record before executing downstream logic. Which comparison is best practice? A) if (acc.Industry != null) B) [CORRECT ANSWER] if (acc.Industry != Trigger.oldMap.get(acc.Id).Industry) C) if (Trigger.isChanged(acc.Industry)) D) if (acc.isModified('Industry')) Rationale: Comparing the field value on Trigger.new against the corresponding record in Trigger.oldMap.get(acc.Id) accurately detects whether that specific field changed during the update. Question 41. How does the Salesforce platform process a batch of 450 records inserted via Data Loader in a single API call? A) All 450 records are passed into Trigger.new in a single trigger execution. B) [CORRECT ANSWER] The platform splits the 450 records into 3 chunks (200, 200, and 50) and invokes the trigger 3 times within the same transaction, sharing one set of governor limits. C) The platform creates 3 separate asynchronous transactions with independent governor limits. D) An exception is thrown because triggers cannot process more than 200 records. Rationale: Triggers process records in chunks of up to 200 records. All chunks within a single API/DML batch execute within the same transaction and share a single pool of governor limits.

Question 46. A developer wants to prevent users from deleting an Account if it has any open Opportunity records. Which trigger event and method should be used? A) after delete using acc.addError('Cannot delete Account with open Opportunities') B) [CORRECT ANSWER] before delete using acc.addError('Cannot delete Account with open Opportunities') C) before update using Database.rollback() D) after update using System.assert(false) Rationale: before delete triggers inspect Trigger.old / Trigger.oldMap and call .addError() on the sObject instance to block deletion cleanly and display the validation message to the user. Question 47. What happens when addError() is called on one record inside a list of 50 records passed to Database.insert(accList, false)? A) All 50 records fail and the entire transaction rolls back. B) [CORRECT ANSWER] Only the record with addError() fails and returns an error in Database.SaveResult, while the remaining 49 valid records succeed. C) An unhandled DmlException is immediately thrown. D) addError() is ignored when allOrNone is set to false. Rationale: With allOrNone = false, addError() rejects only the flagged record(s) and populates Database.SaveResult errors while allowing valid records in the batch to commit. Question 48. Which design best practice is central to building a maintainable enterprise Trigger Framework? A) Write separate triggers for before and after events on every object to isolate SOQL queries. B) [CORRECT ANSWER] Maintain one trigger per sObject and delegate all event routing and business logic to a dedicated Trigger Handler class. C) Place all SOQL queries directly inside the .trigger file for faster compilation. D) Use @future methods inside every trigger to bypass synchronous CPU limits. Rationale: Having a single trigger per sObject guarantees deterministic execution order and delegates logic cleanly to modular handler/service classes. Question 49. How can a developer publish a Platform Event (Order_Shipped__e) from an Apex trigger? A) Database.insert(new Order_Shipped__e(Order_Id__c = '123')); B) [CORRECT ANSWER] EventBus.publish(new Order_Shipped__e(Order_Id__c = '123')); C) System.publishEvent('Order_Shipped__e', '123'); D) Messaging.sendEvent(new Order_Shipped__e()); Rationale: Platform Events are published in Apex using EventBus.publish(), which accepts either a single event sObject or a List of event sObjects.

Question 50. What is an important behavioral difference between publishing a Platform Event configured with Publish After Commit versus Publish Immediately? A) Publish Immediately events cannot be subscribed to by Apex triggers. B) [CORRECT ANSWER] Publish Immediately events are dispatched even if the publishing Apex transaction subsequently fails and rolls back, whereas Publish After Commit events are published only if the transaction commits successfully. C) Publish After Commit events do not count toward DML limits. D) Publish Immediately events run synchronously in the same transaction. Rationale: Publish Immediately fires the event right when EventBus.publish() executes regardless of subsequent transaction rollback, whereas Publish After Commit waits for a successful database commit.

BATCH 2: QUESTIONS 51 – 100 (APEX TRIGGERS & ORDER OF EXECUTION | SOQL, SOSL & GOVERNOR

LIMITS)

Question 51 [Domain 2: Apex Triggers & Order of Execution]

During the Salesforce Save Order of Execution, when do system validation rules (such as required field checks, field format validation, and maximum field length) execute relative to Before Triggers? A) Only after all After Triggers and Workflow Rules have completed. B) Only before Before Triggers; system validation never runs a second time. C) [CORRECT ANSWER] Before Before Triggers (checking layout requiredness and formats), and again after Before Triggers (checking required fields and formats, excluding layout-only requiredness). D) Simultaneously with Database.insert() asynchronous workers. Rationale: Salesforce runs system validation first (including page-layout requiredness if saved from UI), then runs Before Triggers, and then re-runs system validation (excluding layout-only requiredness) plus custom validation rules before saving to the database.

Question 52 [Domain 2: Apex Triggers & Order of Execution]

In which trigger context is Trigger.oldMap populated and non-null, while Trigger.newMap is null? A) Before Insert B) After Insert C) Before Update D) [CORRECT ANSWER] Before Delete Rationale: During delete operations (Before Delete and After Delete), records are being removed so there are no 'new' versions; therefore Trigger.old and Trigger.oldMap are populated, while Trigger.new and Trigger.newMap are null.

Question 57 [Domain 2: Apex Triggers & Order of Execution]

What is the maximum number of records processed in a single trigger execution chunk when 450 records are inserted via Data Loader or Apex DML? A) 100 records per chunk (5 chunks) B) [CORRECT ANSWER] 200 records per chunk (3 chunks: 200, 200, 50) C) 450 records in a single chunk D) 50 records per chunk (9 chunks) Rationale: Salesforce processes DML batches in chunks of up to 200 records per trigger invocation. An insert of 450 records executes the trigger three times with batch sizes of 200, 200, and 50.

Question 58 [Domain 2: Apex Triggers & Order of Execution]

A developer uses a simple public static Boolean hasRun = false; flag inside a trigger handler to prevent recursion. What is a major pitfall of using a single transaction-wide static Boolean flag when inserting 400 records? A) Static variables reset between every trigger event. B) [CORRECT ANSWER] The first chunk of 200 records sets hasRun = true, causing the second chunk of 200 records in the same transaction to be completely skipped by the trigger. C) Static Booleans cannot be accessed inside trigger contexts. D) It causes a LimitException on heap size. Rationale: Static variables persist for the entire transaction across all 200-record chunks. A single Boolean flag blocks chunks 2+ from running. Best practice is to track processed record IDs in a Set rather than using a global Boolean.

Question 59 [Domain 2: Apex Triggers & Order of Execution]

When a master record is deleted in a Master-Detail relationship, what happens to the triggers on the detail (child) records? A) Both Before Delete and After Delete triggers fire on the child records. B) Only After Delete triggers fire on the child records. C) [CORRECT ANSWER] Child records are cascade-deleted at the database layer without firing Apex delete triggers on the child object. D) Deletion fails if the child object has an active Apex trigger. Rationale: When a parent record in a Master-Detail relationship is deleted, Salesforce cascade-deletes the child records directly without firing Before Delete or After Delete triggers on the child object.

Question 60 [Domain 2: Apex Triggers & Order of Execution]

At which point in the Save Order of Execution are Roll-Up Summary fields on a parent record recalculated and saved? A) Before the child record's Before Insert/Update trigger runs. B) [CORRECT ANSWER] After the child record's After Triggers, Entitlement Rules, and Flow/Workflow field updates complete, triggering the parent record's save cycle. C) Simultaneously with the child record's Custom Validation Rules. D) Only during nightly asynchronous batch recalculations. Rationale: If a child record has a Master-Detail parent with Roll-Up Summary fields, Salesforce recalculates the roll-up values after the child's After Triggers and automation complete, which then initiates the parent record's save execution order.

Question 61 [Domain 2: Apex Triggers & Order of Execution]

Which best practice ensures predictable execution order when multiple business processes need to run on the same SObject? A) Create separate triggers per business requirement and name them alphabetically. B) [CORRECT ANSWER] Implement a single trigger per SObject that delegates logic to a structured Trigger Handler framework based on Trigger.operationType. C) Place all SOQL queries directly inside the .trigger file. D) Use @future methods inside every Before trigger. Rationale: Salesforce does not guarantee the execution order of multiple triggers on the same object. Using one trigger per object with a handler framework (dispatching on Trigger.operationType) guarantees deterministic ordering and clean maintainability.

Question 62 [Domain 2: Apex Triggers & Order of Execution]

In the Save Order of Execution, when do Before-Save Record-Triggered Flows execute relative to Before Apex Triggers? A) Before-Save Flows execute after Before Apex Triggers. B) [CORRECT ANSWER] Before-Save Flows execute before Before Apex Triggers. C) Before-Save Flows execute after After Apex Triggers. D) Before-Save Flows and Before Apex Triggers run in parallel threads. Rationale: In Salesforce's Order of Execution, Record-Triggered Flows configured for Fast Field Updates (Before-Save) run immediately prior to Before Apex Triggers.

Question 63 [Domain 2: Apex Triggers & Order of Execution]

In the Save Order of Execution, when do After-Save Record-Triggered Flows execute relative to After Apex Triggers? A) Before Before Apex Triggers. B) Between Before Apex Triggers and the database save. C) [CORRECT ANSWER] After After Apex Triggers, Assignment Rules, Auto-Response Rules, and Workflow Rules. D) Only after the transaction commits to the database. Rationale: Record-Triggered Flows configured for Actions and Related Records (After-Save) execute after After Apex Triggers, Assignment Rules, Auto-Response Rules, Workflow Rules, and Escalation Rules.

Question 68 [Domain 2: Apex Triggers & Order of Execution]

A developer needs to automatically populate a custom field Region__c on an Account based on its BillingCountry before the record is saved. Which trigger event is optimal and avoids extra DML? A) [CORRECT ANSWER] Before Insert and Before Update on Account B) After Insert and After Update on Account C) After Undelete on Account D) Before Delete on Account Rationale: Modifying fields on the same record being saved should be done in Before Insert and Before Update triggers by setting the field on Trigger.new, eliminating the need for an additional DML update statement.

Question 69 [Domain 2: Apex Triggers & Order of Execution]

When a Duplicate Rule is configured to block duplicates on an object, at what point in the Save Order of Execution does it run? A) Before Before Triggers B) [CORRECT ANSWER] After Before Triggers and Custom Validation Rules, before the record is saved to the database C) After After Triggers and Workflow Rules D) Only after the final transaction commit Rationale: Duplicate Rules run after Before Triggers, system validation, and custom validation rules, right before the record is saved to the database (so blocked duplicates never reach After Triggers).

Question 70 [Domain 2: Apex Triggers & Order of Execution]

When all operations in a Save Order of Execution succeed without unhandled exceptions, when is all DML work permanently committed to the Salesforce database? A) Immediately after Before Triggers finish. B) Immediately after After Triggers finish. C) [CORRECT ANSWER] At the very end of the entire synchronous transaction after all post-commit logic is queued. D) After every individual DML statement inside a trigger. Rationale: All DML operations in a synchronous transaction are held in an uncommitted database transaction and committed atomically only when the entire execution flow completes without an unhandled exception.

Question 71 [Domain 3: SOQL, SOSL & Governor Limits]

What is the synchronous per-transaction governor limit for the total number of SOQL queries issued in Apex? A) 50 B) [CORRECT ANSWER] 100 C) 150 D) 200 Rationale: Synchronous Apex transactions are limited to 100 SOQL queries (whereas asynchronous Apex transactions have a limit of 200 SOQL queries).

Question 72 [Domain 3: SOQL, SOSL & Governor Limits]

What is the synchronous per-transaction governor limit for the total number of records retrieved by SOQL queries? A) 10,000 records B) [CORRECT ANSWER] 50,000 records C) 100,000 records D) 2,000 records Rationale: A single Apex transaction can retrieve a maximum of 50,000 records across all SOQL queries combined (unless processed via Database.QueryLocator in Batch Apex, which supports up to 50 million records).

Question 73 [Domain 3: SOQL, SOSL & Governor Limits]

What is the per-transaction governor limit for the total number of DML statements issued in both synchronous and asynchronous Apex? A) 100 B) [CORRECT ANSWER] 150 C) 200 D) 10, Rationale: Both synchronous and asynchronous Apex transactions allow up to 150 DML statements and up to 10, total rows processed across those DML statements.

Question 74 [Domain 3: SOQL, SOSL & Governor Limits]

Which SOQL syntax correctly queries parent Account fields (Name, Industry) from a child Contact query? A) SELECT Id, LastName, Account__r.Name, Account__r.Industry FROM Contact B) [CORRECT ANSWER] SELECT Id, LastName, Account.Name, Account.Industry FROM Contact C) SELECT Id, LastName, (SELECT Name, Industry FROM Accounts) FROM Contact D) SELECT Id, LastName, Parent.Name, Parent.Industry FROM Contact Rationale: For standard lookup/master-detail fields like AccountId, child-to-parent traversal uses the relationship name Account with dot notation (Account.Name). Custom relationships use __r.

Question 75 [Domain 3: SOQL, SOSL & Governor Limits]

Which SOQL query correctly retrieves Accounts along with their related Invoice__c custom child records (where the child relationship name is Invoices)? A) SELECT Id, Name, (SELECT Id, Amount__c FROM Invoice__c) FROM Account B) [CORRECT ANSWER] SELECT Id, Name, (SELECT Id, Amount__c FROM Invoices__r) FROM Account C) SELECT Id, Name, Invoices__r.Amount__c FROM Account D) SELECT Id, Name, (SELECT Id, Amount__c FROM Invoices) FROM Account Rationale: Parent-to-child subqueries in SOQL use the plural child relationship name suffixed with __r for custom relationships (e.g., FROM Invoices__r).