Courseiva

SALESFORCE-PD1 · domain

troubleshooting

Practise Salesforce Certified Platform Developer I (SALESFORCE-PD1) troubleshooting practice questions — original exam-style scenarios with answer choices, explanations, and analysis of common mistakes.

345 questions97 easy140 medium108 hard

Focused practice

Practice troubleshooting questions

Scored sessions drawing only from this domain — pick a length below.

Start 20-question practice test →

What this domain covers

What to know about troubleshooting

troubleshooting questions test whether you can apply the concept in context, not just recognise a definition.

How the topic appears in realistic exam-style scenarios.

Which detail in the question changes the correct answer.

How to eliminate plausible but wrong options.

How to connect the question back to the wider exam objective.

Watch out for

Common troubleshooting exam traps

  • ▸Answering from memory before reading the full scenario.
  • ▸Missing a constraint such as cost, availability, security, scope or command context.
  • ▸Choosing a broad answer when the question asks for the most specific fix.
  • ▸Ignoring why the wrong options are tempting.

Question index

All troubleshooting questions (345)

Click any question to see the full explanation, or start a practice session above.

1

A developer implements a Queueable class that makes an external REST callout. The developer needs to test this class using Test.startTest() and Test.stopTest(). What is required for the callout to succeed in the test method?

Hard
2

A developer is writing a Visualforce page and wants to include standard Salesforce styling and icons. What tag should be added to the top of the Visualforce page?

Easy
3

What must be true for a developer to deploy Apex code to a production environment?

Medium
4

A developer is writing a Batch Apex class to update 50,000 records. Which method must be implemented to define the scope of records to be processed?

Medium
5

When evaluating whether to use Flow Builder or an Apex trigger for record automation, which scenario best justifies choosing an Apex trigger over a Record-Triggered Flow?

Medium
6

Which lifecycle hook in a Lightning Web Component is called after every render of the component?

Easy
7

What is the primary purpose of the Model-View-Controller (MVC) design pattern implementation in Lightning Web Components (LWC)?

Easy
8

A developer needs to invoke an asynchronous method from a standard synchronous Apex trigger. The asynchronous method must be annotated with which keyword?

Easy
9

A developer wants to test an asynchronous future method. Where must the developer place the asynchronous code execution so that it runs synchronously and within the test context?

Medium
10

A developer needs to schedule a class to run nightly at midnight to clean up stale audit records. Which interface must the class implement?

Easy
11

Which THREE techniques help prevent hitting governor limits when writing SOQL queries in Apex? Choose 3 answers.

Hard
12

A developer needs to pass a custom SObject record with related child lists into an asynchronous execution context. Which asynchronous Apex feature supports passing non-primitive types such as custom Apex objects or sObject collections?

Medium
13

A developer is building a Lightning Web Component and wants to define a property that can be set by a parent component. Which decorator is required?

Easy
14

Which of the following describes the behavior of a static variable in Apex?

Hard
15

A developer is writing a Visualforce page and wants to display messages generated by controllers or validation rules. Which component should be used?

Easy
16

In the order of execution, when are custom validation rules evaluated relative to Before Triggers?

Medium
17

A developer needs to access private methods in an Apex class for unit testing without making them public. Which annotation is the most appropriate?

Medium
18

Which TWO best practices should a developer follow when writing bulkified Apex triggers? (Choose TWO.)

Medium
19

Which TWO statements are true regarding the differences between Aura components and Lightning Web Components (LWC)? (Choose TWO)

Easy
20

A developer is troubleshooting an issue where a Lightning Web Component is not picking up changes to the internal fields of an object property. What is the cause of this behavior in LWC reactivity?

Hard
21

A developer created a Screen Flow that collects a Case's priority and assigns it to the Case record. After saving the flow and embedding it on a Lightning record page, users report that the Case's Priority field is not updating even though the flow completes without errors. What is the most likely cause?

Medium
22

A developer creates a Visualforce page and wants to include standard Salesforce styling. Which attribute on the <apex:page> tag enables this?

Easy
23

A developer is working with component styling and design tokens in Lightning Web Components. Which TWO practices apply when working with SLDS styling in LWC? (Choose TWO)

Medium
24

A developer is building a Lightning Web Component and wants to iterate over a list of items in the HTML template. Which directive should be used?

Medium
25

A developer is writing a trigger on the Contact object that needs to reference old field values during an update operation. In which trigger context variable are these previous values stored?

Hard
26

A developer needs to create a Lightning Web Component configuration file. What is the required file extension and naming convention?

Easy
27

Which TWO statements about SOQL relationship queries are true? Choose 2 options.

Medium
28

A developer is using the Lightning Message Service and needs to unsubscribe from a message channel when a component is destroyed. In which lifecycle hook should unsubscribe be called?

Hard
29

Which TWO tools or environments are officially supported for developing Lightning Web Components? (Choose TWO)

Easy
30

A developer needs to process 500,000 records daily and update a custom field based on complex business logic. Which asynchronous Apex feature is specifically designed to handle large batch data processing with flexible scope sizes and built-in transaction monitoring?

Medium
31

A developer needs to write a test class for an Apex class that performs DML operations. Which annotation must be used to define the class as a test class?

Easy
32

A developer needs to execute a lightweight background task that does not require complex chaining or monitoring. Which asynchronous feature is easiest to implement for a single method call?

Medium
33

Which log level is best for finding logic flow issues without cluttering the log?

Medium
34

What is the primary function of a scratch org?

Medium
35

Which THREE criteria are best suited for choosing an Apex Trigger over a Flow?

Medium
36

When is an Apex test run automatically executed?

Hard
37

A developer wants to chain a second asynchronous job from within an executing Queueable Apex job. Which method should be used?

Hard
38

When debugging a trigger, how can you view the flow of execution including entry and exit points of methods?

Medium
39

A developer creates a parent Lightning Web Component containing a child component. The parent needs to call a public method defined inside the child component. How is this accomplished?

Hard
40

A developer is debugging a process that involves asynchronous Apex. Which Debug Log setting is required to see the output of the @future method?

Medium
41

An application uses a SOSL search to find records across multiple objects. Which return type must be used to capture the results in Apex?

Hard
42

A developer is building a custom Lightning Web Component and wants to communicate data from a child component up to its parent component. Which THREE steps are required? (Choose three.)

Medium
43

An Apex trigger needs to prevent records from being saved if a specific validation condition fails. How should the developer reject the DML operation on a specific record?

Hard
44

A developer needs to execute a batch job every Sunday at midnight. Which interface must the scheduling class implement?

Medium
45

A developer is utilizing the Lightning Message Service (LMS) to facilitate communication between an Aura component and a Lightning Web Component. Which THREE steps are required to implement LMS successfully? (Choose THREE)

Hard
46

Which TWO methods are used to inspect sObject field metadata dynamically in Apex? Choose 2 options.

Easy
47

A developer has written a Batch Apex class to process millions of records. During execution, some transactions fail due to temporary external web service timeouts. What is the standard behavior of Batch Apex when an unhandled exception occurs in a batch execution?

Hard
48

A developer is building an Aura component and needs to include a Lightning Web Component inside it. How does the Aura markup reference the LWC?

Medium
49

Which TWO conditions must be met for an Apex method to be wired using the @wire service in an LWC? Choose 2 answers.

Medium
50

Which governor limit is associated with the total number of SOQL queries issued in a single synchronous transaction?

Easy
51

A developer creates a custom LWC that wraps child components. The developer needs to pass styling from the parent component into specific slots of the child component. Which CSS selector should be used inside the child component to style content passed into a slot?

Hard
52

A developer is implementing communication in Lightning Web Components. Which TWO mechanisms are valid for passing data or messages between components? (Choose TWO)

Medium
53

A developer is choosing between Future methods and Queueable Apex. Which TWO characteristics are unique to Queueable Apex? (Choose TWO.)

Medium
54

A developer needs to display a toast notification in a Lightning Web Component when a record is successfully saved. Which module should the developer import?

Medium
55

A developer is writing a batch Apex class. During the execute method, a record fails validation. The developer wants to ensure that successfully processed records in the same batch are committed while failing records are logged without aborting the entire batch. How should the DML be performed?

Hard
56

Which TWO conditions must be met for an Apex test method to successfully execute and contribute to code coverage? (Choose two.)

Medium
57

Which THREE of the following are benefits of using the Salesforce CLI for deployment?

Easy
58

What is the primary benefit of using Flow Builder over Apex triggers when implementing simple field validations?

Easy
59

Which TWO tools or APIs can a developer use to deploy metadata between Salesforce organizations? (Choose two.)

Hard
60

Which tag is used in Visualforce to output field labels and values dynamically based on sObject field definitions?

Easy
61

A developer is troubleshooting lifecycle hooks and rendering behavior in a Lightning Web Component. Which THREE statements are correct regarding LWC lifecycle execution order? (Choose THREE)

Hard
62

A developer needs to ensure that a custom logging operation runs asynchronously and can be monitored using job IDs. Which interface is best suited?

Medium
63

Which context variable in an Apex trigger contains the old map of records for update operations?

Easy
64

A developer needs to find all records across multiple objects (Contact, Lead, and Account) that contain the exact phrase 'Acme Corp'. Which feature should be used?

Medium
65

What is the correct syntax to reference a custom label in a Lightning Web Component JavaScript file?

Easy
66

Which THREE best practices should a developer follow when implementing CRUD and FLS checks in Apex? Choose 3 answers.

Hard
67

A developer is writing code that processes untrusted data and wants to automatically strip fields and relationships that the current user cannot access, without throwing an exception. Which feature should be used?

Hard
68

A developer needs to write an Apex test class for a trigger that fires on Account insert and creates a related Contact. The test must verify that the Contact is created with the correct LastName. Which assertion should be used after inserting the Account and querying for the Contact?

Medium
69

A developer has a trigger that updates parent Account records when Child Contacts are modified. To prevent infinite recursion, the developer uses a static boolean variable in a helper class. What is a key limitation of using static variables for recursion control in Salesforce?

Hard
70

A developer writes a Queueable Apex job that queries 50,000 records, performs calculations, and updates them. During testing, the job hits a heap size limit. What is the standard asynchronous heap size limit in Apex?

Hard
71

Which Apex data type should a developer use to represent a precise geographic location with latitude and longitude coordinates?

Easy
72

Which collection type stores elements as key-value pairs in Apex?

Easy
73

When should a developer choose Flow Builder over an Apex Trigger for business automation?

Easy
74

Why should a developer ensure that test classes have at least 75% coverage for production deployment?

Medium
75

A developer wants to ensure that specific test data is available to all test methods in a class without recreating it. Which method should be used?

Medium
76

An Apex trigger executes during a bulk insert of 300 records. To adhere to best practices regarding governor limits and bulkification, how should SOQL queries be written?

Hard
77

An asynchronous method needs to be invoked from a standard trigger to perform callouts to an external web service. Which annotation is required for this asynchronous method?

Easy
78

A developer has written a Lightning Web Component and Apex controller, and wants to deploy only these specific metadata components to a production org using Salesforce CLI without relying on change sets. Which command is appropriate?

Hard
79

When should a developer choose Flow Builder over Apex for implementing business automation logic?

Medium
80

A developer has a requirement to pass a complex SObject list containing parent and child records into an asynchronous method for further processing. Which asynchronous feature supports passing non-primitive data types such as Lists of SObjects?

Medium
81

Which TWO triggers are executed during a record merge operation in Salesforce? (Choose two.)

Medium
82

A developer needs to pass data from a child Lightning Web Component to a parent Lightning Web Component up the component hierarchy. What is the standard mechanism to achieve this?

Hard
83

A developer needs to include a third-party style sheet in a Lightning Web Component. What is the standard way to load CSS styles that are stored as a static resource?

Medium
84

Which CSS methodology forms the foundation of the styling architecture in Salesforce Lightning Design System (SLDS)?

Easy
85

A developer is writing a SOQL query to find accounts where the billing country starts with 'United'. Which operator should be used?

Medium
86

When using the Metadata API to deploy components, which XML file must be present to define the components included in the package?

Hard
87

An Apex trigger needs to prevent deletion of Account records that have related active Contacts. When should this check occur?

Medium
88

A developer is building a Lightning Web Component and needs to dispatch a custom event. Which constructor should be used to create the event?

Medium
89

Which SOQL aggregate function should a developer use to count the exact number of rows returned by a query without retrieving the records into memory?

Easy
90

A developer needs to execute lightweight asynchronous logic that is chainable and allows passing complex objects to the background job. Which asynchronous feature should the developer implement?

Easy
91

Where should a developer look in the Salesforce user interface to inspect detailed system debug logs generated during a specific transaction?

Easy
92

Which TWO methods are available on the Database class for performing DML operations with partial success capability? Choose 2 options.

Easy
93

A developer needs to dynamically instantiate an sObject type based on a string variable representing the object name (e.g., 'Account'). Which method should be used?

Medium
94

What is the maximum number of batch Apex jobs that can be queued or active concurrently in the Apex flex queue?

Hard
95

A developer needs to ensure that an Apex class respects organization-wide defaults, role hierarchies, and sharing rules when querying custom objects. Which keyword should be added to the class definition?

Medium
96

When calling Test.startTest() and Test.stopTest(), what happens to the governor limits?

Hard
97

Which TWO features are characteristics of SOSL (Salesforce Object Search Language) queries? Choose 2 answers.

Medium
98

Which approach is recommended to ensure test data is cleaned up?

Medium
99

A developer needs to navigate to a record detail page from a Lightning Web Component. Which service should be used?

Medium
100

Which Apex data type is best suited for storing monetary amounts with high precision?

Easy
101

You need to inspect the heap size during the execution of a long-running batch job. Which debug log category should you monitor?

Medium
102

What is the correct file extension for an Apex class created in Salesforce DX?

Easy
103

A developer wants to conditionally display an HTML element in a Lightning Web Component template based on a boolean property named 'isVisible'. Which directive should be used?

Medium
104

A developer is writing a test for a method that performs a callout. How must the callout be handled?

Hard
105

A developer wants to retrieve up to 5 recently viewed records of any object type using SOSL. Which SOSL clause specifies the maximum number of records to return?

Easy
106

During the execution of a trigger, an unhandled exception occurs in an after update trigger. What happens to the database transaction?

Hard
107

A developer writes a SOQL query to aggregate total opportunity amounts grouped by stage name. Which SOQL clause is required?

Medium
108

Which TWO data types can be used as keys in an Apex Map? Choose 2 answers.

Medium
109

When deploying metadata from a sandbox to production using Change Sets, what is the first requirement?

Easy
110

A developer is writing an Apex trigger and needs to optimize performance and prevent governor limit violations. Which TWO practices should the developer follow? (Choose two.)

Medium
111

A developer needs to configure a Lightning Web Component to be available for use on Lightning Record Pages. Which configuration entry must be present in the component's metadata file (.js-meta.xml)?

Medium
112

A developer is writing a unit test that executes under a specific user context to verify sharing rules. Which method should the developer use to specify the user for the subsequent test operations?

Hard
113

Which tag is used in Visualforce to include custom CSS stylesheets?

Easy
114

A developer wants to define a constant value in an Apex class that can be accessed globally without instantiating the class. Which combination of keywords should be used?

Easy
115

A developer has written a Before Insert trigger on the Contact object that needs to validate user input and potentially prevent the record from saving. Which method on the Trigger context or record instance should the developer use to flag an error?

Medium
116

A developer needs to format a currency value according to the user's locale in a Lightning Web Component HTML template. Which base component should be used?

Medium
117

What happens if a developer creates a test method that does not contain any assertions?

Medium
118

A developer needs to create a custom tab for a Lightning Web Component so it can be navigated to from the App Launcher. What type of custom tab must be created?

Easy
119

A developer is working with a Lightning Web Component and needs to access a child component's public method from the parent component. How is this achieved?

Hard
120

What is the primary benefit of using a Flow over an Apex trigger for simple field updates?

Easy
121

Which TWO statements are true regarding the behavior of Apex triggers and context variables? Choose 2 answers.

Medium
122

Which THREE collections are available in Apex? (Choose three.)

Easy
123

What is a key advantage of using Queueable Apex over future methods?

Easy
124

A developer is styling a Lightning Web Component using the Salesforce Lightning Design System (SLDS). To ensure the component adheres to the standard styling guidelines for spacing, what should the developer use?

Easy
125

A developer needs to execute long-running computations that require complex chaining and the ability to pass non-primitive data types to the job. Which asynchronous feature should the developer implement?

Easy
126

Which TWO features are characteristic of Flow Builder compared to Apex triggers? (Choose two.)

Easy
127

A developer is writing a test method that performs a callout to an external REST service. Which interface must the developer implement to provide mock responses during the unit test execution?

Medium
128

Which tool provides a declarative alternative to Apex triggers for creating records when another record is created?

Easy
129

A developer needs to see how much memory a specific Apex method is consuming. Which log category should be adjusted?

Medium
130

Which lifecycle hook in a Lightning Web Component runs after every render of the component?

Easy
131

A developer wants to log information specifically when a condition is met. Which method is most appropriate?

Medium
132

An architect is designing an automation solution and wants to decide between a Record-Triggered Flow and an Apex Trigger. Which scenario heavily favors choosing an Apex Trigger?

Medium
133

A developer is building a Lightning Web Component that displays a toast notification when a user successfully saves a record. Which module should the developer import to use the ShowToastEvent?

Medium
134

An Apex trigger needs to prevent duplicate records from being inserted based on a custom external ID field. Which approach should the developer take to optimize query performance and respect governor limits?

Hard
135

Which THREE factors can cause an Apex CPU time limit exception in a synchronous transaction? Choose 3 answers.

Hard
136

A developer needs to process 2 million records asynchronously, performing complex calculations and updating parent records in batches of 2,000. Which feature should the developer implement?

Medium
137

A developer needs to write a Batch Apex class that processes records and ensures atomicity per batch chunk. Which TWO statements are true regarding Database.Batchable execution and error handling? (Choose TWO.)

Hard
138

A developer is analyzing the Salesforce order of execution for a record update. Which TWO events occur AFTER custom validation rules are evaluated? (Choose TWO.)

Hard
139

A developer needs to assign a default value to a custom picklist field via Apex when creating a Lead record. What data type should be assigned to the picklist field in Apex?

Medium
140

Which THREE tools or contexts can be used to execute Anonymous Apex code? Choose 3 options.

Hard
141

A developer is writing an Apex test class and needs to reset governor limits before executing a block of asynchronous code testing. Which method should the developer use?

Easy
142

A developer needs to access the old values of a record in an Apex trigger. Which collection provides this?

Hard
143

A developer wants to style a Lightning Web Component using the Salesforce Lightning Design System (SLDS). What is the recommended way to include SLDS styling?

Easy
144

A developer writes an Apex trigger that performs a SOQL query inside a standard for-loop processing Trigger.new. Which governor limit is most likely to be exceeded?

Medium
145

An asynchronous @future method is called from within an Apex test method. When are the statements inside the @future method actually executed during the test run?

Hard
146

A developer is troubleshooting a complex set of triggers and wants to restrict the amount of debug log data captured for a specific integration user. Which THREE actions can the developer take to manage debug logs effectively? (Choose three.)

Hard
147

A developer needs to store a collection of Account IDs where duplicates are automatically prevented and lookups are extremely fast. Which collection type should the developer use?

Easy
148

Which THREE operations can cause an automatic roll back of an entire Apex transaction? Choose 3 options.

Hard
149

A developer needs to verify that a trigger correctly handles bulk data, specifically 250 records. What is the most effective approach?

Medium
150

A developer needs to convert a JSON string representing a list of Account objects into an actual Apex List of Accounts. Which method should be used?

Medium
151

A developer needs to check if a specific key exists in a Map<String, Decimal> before retrieving its value. Which Map method should be used?

Easy
152

Which TWO features are provided out-of-the-box by Visualforce when building standard user interfaces? (Choose TWO)

Easy
153

An enterprise application requires Apex code to check whether the current user has read access to a specific custom field before displaying it in a custom Lightning Web Component. What is the most appropriate class to use?

Hard
154

Which method is used in an Apex trigger to display a custom error message on a specific record during a before insert event?

Easy
155

Which tool or feature in Salesforce Developer Console allows a developer to inspect debug logs and filter them by category and level?

Easy
156

What is the primary function of the 'Developer Console'?

Easy
157

A developer needs to execute logic before a record is inserted into the Database to validate field values and prevent invalid records from saving. Which trigger event should the developer use?

Easy
158

A developer needs to schedule an Apex class to run weekly. Which THREE elements are required to implement Schedulable Apex? (Choose THREE.)

Medium
159

A developer is receiving 'Too many SOQL queries' errors in a trigger. What is the most likely cause?

Medium
160

Which TWO actions can a developer perform using standard Visualforce controllers? Choose 2 answers.

Easy
161

What is the maximum number of SOQL queries that can be issued in a single synchronous Apex transaction?

Easy
162

Which SLDS utility class should a developer use to add a standard margin around a container?

Easy
163

Which tool is best suited for migrating metadata between two related Salesforce Orgs using a UI-based approach?

Easy
164

What is the result of a compilation error in an Apex class during deployment?

Easy
165

A developer is creating a Lightning Web Component that needs to interact with Salesforce data using Lightning Data Service. Which TWO wire adapters are natively available in the @salesforce/apex or lightning/ui* modules for basic record operations? (Choose TWO)

Easy
166

A developer is creating a Visualforce page that overrides the standard Account View action. Which attribute must be included in the <apex:page> tag to ensure standard controller functionality?

Easy
167

Which TWO actions can be performed inside a before insert Apex trigger without causing a runtime exception? (Choose two.)

Medium
168

A developer is implementing error handling for an imperative Apex call in a Lightning Web Component. Which THREE properties or techniques are standard for catching and inspecting errors returned from Apex promises? (Choose THREE)

Hard
169

An Apex trigger invokes a helper method that performs a DML operation, but the developer wants to establish a rollback point so that prior changes can be reverted if a subsequent error occurs. Which feature should be used?

Hard
170

If a developer uses 'SeeAllData=true' in a test class, what are the primary risks?

Medium
171

A developer is reviewing a Lightning Web Component that makes calls to an Apex controller. Which THREE best practices should be followed when designing the Apex methods for LWC consumption? (Choose THREE)

Hard
172

How can a developer identify the most time-consuming SOQL query in a transaction?

Medium
173

What is the purpose of the 'Debug Log' Filter in the Developer Console?

Medium
174

Which TWO actions occur automatically when Test.stopTest() is called in an Apex unit test? (Choose two.)

Easy
175

A developer is writing an Apex trigger on the Case object that updates the Case's Status field based on the Priority. The trigger must handle bulk updates and avoid recursion. Which approach should the developer take to prevent the trigger from firing again when the Case records are updated by the trigger itself?

Medium
176

A developer needs to convert a String variable containing a numeric value into an Integer in Apex. Which method should be used?

Medium
177

Which method is used to get the number of elements in an Apex List?

Easy
178

A developer is building a Lightning Web Component and needs to navigate to a URL that is external to Salesforce. Which PageReference type should be used with NavigationMixin?

Medium
179

Which TWO primitive data types are natively supported in Apex? Choose 2 options.

Easy
180

Which TWO lifecycle hooks are available in Lightning Web Components? Choose 2 answers.

Easy
181

A developer is building a Lightning Web Component and needs to perform validation on an input field before submission. Which method on a lighting-input element checks validity?

Medium
182

Which feature allows administrators to invoke an Apex method from a Flow?

Easy
183

Which TWO statements about SOSL (Salesforce Object Search Language) are true? Choose 2 options.

Medium
184

During the Salesforce order of execution, when are validation rules evaluated relative to before triggers?

Hard
185

Which THREE statements are true regarding Lightning Web Component shadow DOM encapsulation? Choose 3 answers.

Hard
186

A developer has written a trigger on the Account object that performs a SOQL query inside a for-loop. The developer notices that when a data load of 200 records occurs, governor limits are exceeded. What is the most efficient way to refactor this trigger?

Medium
187

A developer is writing a Lightning Web Component and needs to load a third-party JavaScript library (such as D3.js) stored as a static resource. Which lifecycle hook is most appropriate for initiating the load using loadScript?

Hard
188

A developer needs to write a test class for a Batch Apex job. Which method must be called to verify that the batch job executes correctly?

Medium
189

A developer needs to apply a custom discount to a list of Opportunity records and then persist the changes to Salesforce. The logic must be reusable both from an Apex trigger and from an Apex controller invoked by a Lightning web component. Which approach best satisfies the requirement while following Apex best practices?

Medium
190

Which TWO tools or features should a developer consider when choosing between Flow Builder and Apex for business logic automation? (Choose two.)

Medium
191

Which base component should be used in LWC to display a tabular grid of data with sorting and row selection?

Easy
192

You are using the Salesforce CLI to deploy code. Which command is used to deploy source code from a local project to an org?

Hard
193

Which THREE items are included in a debug log?

Medium
194

Which THREE actions can cause a governor limit exception during a poorly optimized trigger execution? (Choose three.)

Hard
195

What is the maximum number of asynchronous batch jobs that can be queued or active concurrently in the Flex Queue?

Easy
196

A developer needs to update a related record. If using Apex, what is the best practice to avoid hitting governor limits?

Medium
197

A developer needs to execute initialization logic as soon as a Lightning Web Component is inserted into the DOM. Which lifecycle hook should be used?

Medium
198

Why does a test fail if it tries to perform a callout without Test.setMock()?

Medium
199

Which TWO collection interfaces or classes are provided in Apex? Choose 2 options.

Easy
200

A developer is building a Lightning Web Component and needs to listen to a custom event dispatched by a child component. How is the event listener attached in the parent HTML template?

Hard
201

A developer is building a Lightning Web Component that includes a custom wire adapter to fetch custom metadata. The wire adapter needs to react whenever a tracked property changes value. How should the developer wire the property?

Hard
202

Which collection type in Apex stores elements as key-value pairs where each key maps to a single value?

Easy
203

A developer needs to retrieve Salesforce data in a Lightning Web Component without writing imperative Apex. Which module should be imported to use the wire service for standard record data?

Medium
204

An Apex trigger processes a list of Case records. The developer wants to group the cases by their AccountId. Which data structure is best suited for this grouping?

Hard
205

Which THREE of the following items can be viewed in a debug log?

Medium
206

A developer creates a Lightning Web Component that includes a third-party JavaScript library loaded via a Static Resource. In which lifecycle hook should the third-party library be initialized?

Hard
207

A developer wants to schedule an Apex class to run daily. Which interface must the class implement?

Medium
208

A developer is building a Visualforce page that uses a custom controller and needs to display a message to the user when an error occurs. Which class and method should be used?

Medium
209

Which TWO statements are true regarding Queueable Apex compared to future methods? (Choose two.)

Medium
210

A developer needs to ensure that a validation rule on the Opportunity object fires only when the Stage is 'Closed Won' and the Amount is less than 1000. Which formula should be used in the validation rule's error condition?

Easy
211

When should a developer choose to implement Schedulable Apex? (Choose two.)

Medium
212

A developer has a requirement to perform a callout to an external ERP system immediately when an Opportunity reaches Closed Won. The developer decides to use a future method from an after update trigger. What is a primary architectural limitation of this approach?

Hard
213

Which component of the MVC design pattern in Salesforce Lightning Web Components (LWC) represents the data model and business logic layer?

Easy
214

A developer is implementing a Lightning Web Component with a custom CSS file. How does the component load its associated stylesheet?

Medium
215

A developer writes an Apex method that executes a SOQL query inside a for-loop over a list of 200 Account records. Which governor limit is most likely to be immediately breached?

Hard
216

A developer is analyzing a debug log and notices that it is truncated because it exceeded the maximum file size limit. Which action should the developer take to capture only the relevant Apex code execution details without exceeding the limit?

Medium
217

An application has complex business logic where an Apex class called from a trigger needs to know whether it was invoked from an insert or update trigger context. How can the developer determine this?

Hard
218

A developer writes an Apex method with the 'inherited sharing' keyword. What is the behavior of this class when invoked from a class declared with 'with sharing'?

Hard
219

Which interface enables an Apex class to be invoked from a Flow using the InvocableAction framework?

Easy
220

A developer writes a SOQL query to fetch Account records and wants to bind a list of strings called 'targetNames' as filter criteria. Which syntax is correct?

Medium
221

What is the primary purpose of the Salesforce CLI in a CI/CD pipeline?

Medium
222

A developer is building a Lightning Web Component and needs to execute code as soon as the component is inserted into the DOM. Which lifecycle hook should the developer use?

Easy
223

An enterprise application requires real-time integration where outgoing callouts must be triggered from an Apex trigger. What architectural pattern must the developer use?

Medium
224

Which THREE actions are best practices when deploying Apex classes to production?

Hard
225

A developer is implementing navigation in a Lightning Experience app using the NavigationMixin service in a Lightning Web Component. The developer wants to navigate to a standard ListView for the Account object. What is the correct type to specify?

Hard
226

A developer is troubleshooting a Lightning Web Component where data returned from an Apex wire adapter needs to be mutated before being rendered. What is the correct pattern to handle this?

Hard
227

A developer needs to check the status of a long-running batch job that was triggered by an Apex class. Where should they look?

Medium
228

Which TWO practices are considered best practices when writing Apex unit tests in Salesforce? (Choose two.)

Easy
229

What is a 'Change Set' used for?

Easy
230

Which TWO types of triggers can be defined in Apex? Choose 2 options.

Medium
231

What is the correct file extension for a Lightning Web Component HTML template file?

Easy
232

A developer is writing a Queueable class that needs to make a callout and also perform a DML operation afterward in the same transaction. Which interface must be added to the Queueable class definition?

Hard
233

A developer creates an Apex trigger that updates related Contact records whenever an Account record is updated. The trigger performs a DML operation on the Contacts. During testing, updating an Account causes the trigger to fire infinitely and throw a System.LimitException: Maximum trigger depth exceeded. Which design pattern should the developer implement to prevent this recursion?

Hard
234

A developer is configuring a Lightning Web Component that uses the Lightning Message Service (LMS). Which module must be imported to publish a message on a message channel?

Hard
235

Which THREE statements are accurate regarding Apex transaction control and database savepoints? Choose 3 answers.

Hard
236

A developer writes a SOQL query using the FORMAT() keyword. What is the purpose of this keyword?

Medium
237

A developer needs to ensure that an Apex trigger fires only during the after insert context. Which check should be placed at the beginning of the trigger body?

Medium
238

A developer is writing a Visualforce page with custom controller logic and needs to ensure that database operations are executed transactionally. What happens by default when an unhandled exception occurs during a controller action method?

Medium
239

A developer has a Lightning Web Component with a reactive property 'recordId'. How should the property be decorated to ensure it receives the current record ID when placed on a record page?

Medium
240

Which TWO tools are effective for monitoring asynchronous Apex jobs?

Medium
241

A developer wants to include a custom styling hook to override a standard Lightning Design System component token in a Lightning Web Component. Where should this CSS custom property be defined?

Easy
242

Which best practice should be followed when writing Apex triggers to ensure bulkification?

Easy
243

During the Salesforce save order of execution, when are before triggers executed relative to custom validation rules?

Hard
244

A developer needs to ensure that a specific Apex method runs asynchronously because it makes a callout to an external REST API from a standard user interface controller. Which annotation must be added to the method?

Easy
245

Which THREE statements are true regarding asynchronous Apex governor limits and execution behavior? (Choose three.)

Hard
246

A developer has a trigger that updates related child records. To prevent recursive trigger execution when updates ripple through child triggers, what is a standard best practice design pattern?

Hard
247

Which THREE pieces of information are displayed in the Apex Test Execution page?

Medium
248

A developer is troubleshooting a transaction that exceeds governor limits due to SOQL queries. Which THREE techniques help prevent hitting SOQL query limits in Apex? (Choose THREE.)

Hard
249

Which TWO techniques can be used to pass data from a parent component to a child Lightning Web Component? Choose 2 answers.

Medium
250

A developer implements a Schedulable class to run a daily cleanup job. What is the maximum number of scheduled Apex jobs that can be simultaneously active in an org?

Hard
251

An Apex trigger executes a query inside a for-loop to fetch related child records for every parent Account in Trigger.new. The developer notices that when a data load of 200 accounts occurs, the governor limit for total SOQL queries issued is exceeded. How should the developer refactor the code?

Hard
252

When a record-triggered flow performs an action that causes a trigger to fire, which order of execution phase is this?

Hard
253

A developer creates a Lightning Web Component that consumes data from a wire adapter. The wire adapter returns an object with 'data' and 'error' properties. What is this pattern called in LWC?

Hard
254

Which context variable should a developer use in an Apex trigger to determine if the trigger was fired by an update operation rather than an insert?

Easy
255

A developer is building a Lightning Web Component that must be made available for use on Lightning Record Pages. Which configuration tag must be included in the component's metadata file?

Easy
256

Which THREE items are best practices when setting up test data using @TestSetup methods? (Choose three.)

Hard
257

Which THREE data types are primitive data types supported in Apex? (Choose three.)

Easy
258

Which log level displays the most information?

Easy
259

Which THREE things can a developer do with the Salesforce CLI?

Hard
260

Which of these is NOT a valid testing best practice?

Easy
261

When testing asynchronous Apex, how do you ensure that the scheduled job has finished before asserting results?

Hard
262

A developer is writing a test class for an Apex trigger and needs to insert test Account records. Best practices recommend bypassing hardcoded IDs. Which annotation should be placed on the test setup method to create common test data efficiently?

Medium
263

What is the primary benefit of using a Sandbox for development?

Medium
264

A developer is troubleshooting an Apex trigger recursion issue where an update operation triggers itself infinitely. Which THREE strategies can the developer use to safely prevent this recursion? Choose 3 options.

Hard
265

A developer encounters a 'System.AsyncException: Maximum queueable jobs added to the queue' error. What caused this exception?

Hard
266

A developer receives a System.LimitException: Too many SOQL queries: 101 when running a complex unit test. The test class inserts a large volume of test records that inadvertently cause a trigger to execute multiple queries inside a loop. What is the most effective way to reset the governor limits specifically for the code being tested?

Hard
267

A developer needs to catch unhandled JavaScript errors in a Lightning Web Component hierarchy so the entire app doesn't crash. Which lifecycle hook handles errors thrown by descendant components?

Hard
268

A developer needs to verify code coverage across an entire Apex organization before deploying code to production. What is the minimum overall Apex code coverage required by Salesforce for production deployment?

Easy
269

Which governor limit applies to the total CPU time in a single synchronous Apex transaction?

Easy
270

Which THREE requirements must be met when implementing a custom Lightning Web Component pagination control? Choose 3 answers.

Hard
271

A developer is using Salesforce CLI to create a temporary environment for feature development and testing that includes all source code and shape settings. Which CLI command should the developer use to create this temporary environment?

Medium
272

A developer is implementing a Batch Apex class to process 500,000 Contact records. Which method defines the starting point and retrieves the records to be processed?

Medium
273

Which TWO actions should a developer take when handling errors returned by an imperative Apex call in a Lightning Web Component? Choose 2 answers.

Medium
274

A developer needs to chain asynchronous jobs. Which interface allows for a single job to be queued from within the execution of another?

Hard
275

A developer is using 'Test.isRunningTest()' in their production code. Why is this generally considered a poor practice?

Hard
276

A developer is creating a reusable LWC utility and needs to invoke an Apex method imperatively. The method accepts a record ID parameter. What is the correct way to pass this parameter in JavaScript?

Medium
277

An Apex trigger performs a callout to an external web service and a developer is writing a unit test for this trigger. How should the developer handle the callout during the test execution?

Hard
278

Which trigger context variable should a developer use to access the map of old record versions prior to the update operation?

Easy
279

Which of the following describes the behavior of Test.stopTest()?

Medium
280

Which TWO features of @isTest(SeeAllData=true) should a developer be aware of?

Medium
281

A developer wants to inspect the code coverage of individual classes directly within the Salesforce Developer Console. Under which tab can the developer view this breakdown?

Easy
282

A developer wants to ensure that a custom Apex controller method can be invoked securely from a Lightning Web Component. Which annotation must be applied to the method?

Medium
283

How can a developer inspect the state of a private variable within a class during unit testing?

Medium
284

A developer needs to implement a custom logging framework. Which Apex data type should be used to represent a variable that can store any primitive value, sObject, or collection dynamically?

Hard
285

When should a developer use a record-triggered flow instead of a scheduled path in a flow?

Easy
286

A developer is writing a custom wire adapter or working with custom data in LWC and needs to manually provision data or force a refresh of wire data. Which function should be imported from lightning/uiRecordApi or related wire modules?

Hard
287

Which TWO of the following are valid ways to trigger an Apex test run?

Medium
288

You are debugging a performance issue in an Apex trigger. You want to see the database resource usage. Which debug log level should you set for the Database category?

Medium
289

A developer is designing a Lightning Web Component that needs to be conditionally displayed in different Salesforce containers. Which TWO targets are valid entries in the component's js-meta.xml configuration file? (Choose TWO)

Medium
290

What happens if a test class has a method annotated with @testSetup that fails to insert data?

Hard
291

A developer needs to store a collection of unique customer email addresses in Apex and check for existence efficiently. Which collection type should the developer use?

Easy
292

When should a developer choose a Record-Triggered Flow over an Apex trigger for automating record updates before save?

Medium
293

Which trigger event handles the restoration of records from the Recycle Bin?

Easy
294

A developer needs to abort a scheduled Apex job programmatically from within a test class or maintenance script. Which method should be used?

Hard
295

Which TWO best practices should developers follow when implementing Queueable Apex chaining? (Choose two.)

Medium
296

A developer is creating a Lightning Web Component and needs to iterate over a list of items in the HTML template. Which directive should be used?

Medium
297

A developer is deploying a profile and custom fields using an Unmanaged Change Set. Upon deployment, some custom field permissions fail to apply correctly in production. What is the most likely cause of this behavior?

Medium
298

Which THREE strategies are recommended for improving the performance of Lightning Web Components rendering large lists of data? Choose 3 answers.

Hard
299

An Apex trigger needs to update fields on the same record that is currently being inserted in a Before Insert trigger context. How should the developer implement this update?

Medium
300

A developer writes an Apex trigger that performs a DML operation on Account records. The Account has a Roll-Up Summary field calculated from child Contact records. What happens during the order of execution regarding roll-up summary field calculations?

Hard
301

A developer is working with a Lightning Web Component and needs to ensure reactive updates occur when an object property or array element changes inside a tracked property. What is the correct approach in modern LWC?

Hard
302

A batch Apex class processes 50,000 records. During the execute method, a custom governor limit is approached. Which method can the developer call to check the remaining CPU time dynamically?

Hard
303

An Apex trigger needs to check whether the current user has read access to the 'AnnualRevenue' field on the Account object before performing a calculation. Which method should the developer use?

Medium
304

A developer is building a solution that requires complex branching logic. When should the developer choose Apex over Flow?

Medium
305

Which THREE design patterns or tools help ensure secure coding practices regarding CRUD and FLS in Apex? Choose 3 options.

Hard
306

A developer is implementing a Lightning Web Component that handles drag-and-drop functionality. Which native DOM event is typically intercepted to allow a drop action on an element?

Hard
307

Which TWO of the following statements about Trigger.new and Trigger.old are accurate?

Medium
308

Which type of Apex trigger context variable returns a list of new versions of the sObject records?

Easy
309

When testing a trigger, why should you avoid hard-coding IDs?

Hard
310

Which trigger context variable returns a map of IDs to the new versions of the sObject records?

Easy
311

A developer is writing an Aura component and needs to dynamically create a component at runtime. Which JavaScript method should be used?

Hard
312

An Apex trigger processes a large volume of Opportunity updates. The developer uses Database.update(opps, false) to allow partial success. How should the developer inspect the results to handle any failures?

Hard
313

A developer needs to access a specific HTML element in a Lightning Web Component template imperatively. Which method should be called?

Hard
314

What is the primary purpose of the 'System.debug()' statement?

Medium
315

A developer is writing a Visualforce page that uses a custom controller. The page needs to execute an action method as soon as the page loads, without requiring user interaction. Which attribute on <apex:page> should be used?

Medium
316

Which tool is best for automating a process that requires UI interaction, such as a wizard screen?

Easy
317

A developer writes an Apex method that executes a SOQL query using user-supplied search parameters. How can the developer protect against SOQL injection vulnerabilities?

Hard
318

A developer is creating a Lightning Web Component that needs to conditionally render a section based on a boolean property. The property is initially false and is set to true after data is loaded from an Apex method. Which approach should the developer use to ensure the section renders only when the property is true?

Hard
319

A developer needs to write a unit test for a Queueable Apex class. How should the developer verify that the Queueable job executed successfully?

Medium
320

Which THREE of the following are true about Apex test data setup?

Medium
321

A developer needs to execute a dynamic SOQL query where the object name and fields are determined at runtime. Which method should be used?

Medium
322

A developer is working with a Lightning Web Component that uses the @wire decorator to provision data from an Apex method. The Apex method depends on a property that changes dynamically. How should the property be prefixed to signal reactivity to the wire service?

Medium
323

A developer is writing an Apex trigger and needs to ensure proper bulkification. Which TWO practices should the developer follow to avoid governor limits? (Choose two.)

Medium
324

Which primitive data type in Apex can represent a specific point in time, including both date and time values?

Easy
325

A developer is implementing a custom pagination mechanism in a Lightning Web Component. The component uses an Apex controller method that returns a list of records. Which technique prevents excessive heap size and improves performance when dealing with large datasets?

Hard
326

A developer needs to iterate over a map of Account IDs to Account sObjects and perform processing on each value. Which loop construct is valid Apex?

Hard
327

Which THREE practices are considered security best practices when developing custom Visualforce pages to prevent Cross-Site Scripting (XSS)? Choose 3 answers.

Hard
328

A developer is writing an Apex method and needs to store a collection of unique email addresses while maintaining fast lookup times. Which collection should the developer choose?

Easy
329

A developer needs to query all Contact records, including those that have been deleted from the database via the Recycle Bin. Which SOQL clause must be added?

Medium
330

When comparing Flow Builder decision points and Apex trigger logic, which THREE statements are valid design considerations? (Choose THREE.)

Medium
331

A developer needs to query all Contact records, including those that have been moved to the Recycle Bin. Which SOQL keyword should be used?

Medium
332

A developer needs to ensure that a Lightning Web Component can be placed on a Record Page for an Account in the Lightning App Builder. What must be configured in the component's metadata configuration file?

Easy
333

A developer implemented a Queueable Apex class that performs heavy processing. During testing, the developer wants to verify whether the asynchronous job has finished executing before running dependent unit test assertions. What should the developer use?

Medium
334

When using the Salesforce CLI to deploy, what is the 'check-only' flag used for?

Hard
335

A developer has an Aura component that needs to communicate with an unrelated Lightning Web Component located on the same Lightning page. Which feature should the developer implement?

Hard
336

A developer is building a Lightning Web Component that displays a list of contacts for a selected account. The component must call an Apex method that returns contacts, and the developer wants to handle the result using a Promise chain. Which Apex method annotation is required to expose the method to the Lightning Web Component?

Medium
337

A developer is building a Lightning Web Component that includes user input fields. To adhere to best practices for accessibility and SLDS form styling, how should form inputs be structured?

Medium
338

A developer needs to run a batch job that queries records and updates them. What is the default batch size if no optional batch size parameter is specified in Database.executeBatch()?

Medium
339

A developer is building a Lightning Web Component and needs to execute code as soon as the component is inserted into the DOM. Which lifecycle hook should be used?

Easy
340

A developer implements a Queueable class that makes callouts and needs to test it using Test.startTest() and Test.stopTest(). When does the asynchronous queueable job execute during a unit test?

Hard
341

A developer creates a Trigger on the Account object that performs a SOQL query inside a for loop. While testing with bulk data operations, the developer encounters a governor limit exception. Which limit is most likely exceeded?

Hard
342

A developer is creating an Aura component that interacts with Salesforce data. Which TWO tags or features are valid in the Aura framework? (Choose TWO)

Medium
343

Which THREE factors influence deployment success?

Hard
344

A developer is designing an asynchronous architecture using Batch Apex. Which THREE considerations must be kept in mind regarding Batch Apex behavior? (Choose THREE.)

Hard
345

Which TWO of the following are valid deployment tools?

Medium

Frequently asked questions

What does the troubleshooting domain cover on the SALESFORCE-PD1 exam?
troubleshooting questions test whether you can apply the concept in context, not just recognise a definition.
How many questions are in this domain?
This page lists all 345 troubleshooting questions in the SALESFORCE-PD1 question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
What is the best way to practise this domain?
Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
Can I practise only troubleshooting questions?
Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.