Courseiva

Salesforce Certified Platform Developer I (SALESFORCE-PD1) (SALESFORCE-PD1) — Questions 151225

493 questions total · 7pages · All types, answers revealed

Page 2

Page 3 of 7

Page 4
151
MCQmedium

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

A.Use the Test.stopTest() method.
B.The platform automatically rolls back data created in tests.
C.Delete the records manually in the finally block.
D.Use a @testSetup method for cleanup.
AnswerB

This ensures no data side effects.

Why this answer

Salesforce automatically rolls back all data created in a test method after completion.

152
Multi-Selecthard

Which THREE operations will cause an immediate transaction rollback or DML failure when utilizing standard DML statements in Apex? Choose 3 answers.

Select 3 answers
A.A record failing a validation rule triggered by the DML operation.
B.Updating a record that has already been committed in the database.
C.Using the Database.insert(list, false) method with a failing record.
D.Calling record.addError() inside a trigger context.
E.Exceeding the maximum heap size limit during processing.
AnswersA, D, E

Validation rule failures cause the entire standard DML transaction to roll back.

Why this answer

Uncaught exceptions, hit governor limits, or triggering record-level validation errors via addError() will fail the transaction or records.

153
MCQmedium

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

A.lightning/pageReference
B.window.location.href
C.lightning/uiRecordApi
D.lightning/navigation
AnswerD

Provides navigation service methods.

Why this answer

NavigationMixin from lightning/navigation is used for navigation in LWCs.

154
MCQeasy

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

A.Decimal
B.Double
C.String
D.Integer
AnswerA

Decimal is precise and is the standard type used for currency fields in Salesforce.

Why this answer

The Decimal data type is used for currency and precise numerical calculations in Apex.

155
MCQmedium

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

A.Apex Code
B.Validation
C.Profiling
D.Workflow
AnswerC

Profiling is specifically designed for monitoring resource consumption.

Why this answer

The Profiling category logs governor limit usage, including heap size and CPU time.

156
MCQeasy

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

A..apex
B..controller
C..cls
D..trigger
AnswerC

Apex classes use the .cls extension.

Why this answer

Apex class files use the .cls extension, accompanied by a .cls-meta.xml metadata file.

157
MCQmedium

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?

A.renderIf
B.aura:if
C.v:if
D.lwc:if
AnswerD

Conditionally renders DOM elements based on a boolean expression.

Why this answer

lwc:if is the modern conditional directive in LWC.

158
MCQeasy

Which trigger context variable is available exclusively in before insert, before update, and before delete triggers to modify field values?

A.Trigger.new
B.Trigger.old
C.Trigger.oldMap
D.Trigger.newMap
AnswerA

Modifications to sObjects in Trigger.new within before triggers are automatically saved to the database without needing an explicit DML statement.

Why this answer

Trigger.new contains sObjects that can be modified in-flight during before insert and before update triggers.

159
Multi-Selecthard

Which TWO of the following are true about the 'Debug Log' settings in the Setup menu?

Select 2 answers
A.Debug logs can only be generated for the System Administrator profile
B.Setting a trace flag on a user consumes API calls
C.Trace flags have an expiration date and time
D.You can set log levels for specific users
E.Logs can be set to last for an infinite duration
AnswersC, D

Trace flags must be defined with an expiration window.

Why this answer

Logs can be set for users, and the duration of those log traces is limited.

160
MCQhard

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

A.Use the @future annotation.
B.Use Test.startTest().
C.The test will automatically fail.
D.Implement the HttpCalloutMock interface.
AnswerD

Standard practice for testing callouts.

Why this answer

Callouts must be mocked using HttpCalloutMock to avoid external network dependencies.

161
MCQeasy

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?

A.TOP 5
B.MAX 5
C.LIMIT 5
D.ROWS 5
AnswerC

The LIMIT clause restricts the number of rows returned by a SOSL query.

Why this answer

SOSL search results can be limited using the LIMIT clause at the end of the query statement.

162
Multi-Selectmedium

Which THREE statements are true regarding Future methods in Apex? Choose 3 options.

Select 2 answers
A.Future methods can accept sObjects or lists of sObjects as parameters.
B.Future methods must be annotated with the @future annotation.
C.Future methods must be static and return either void or a primitive type.
D.Future methods run asynchronously in their own thread when system resources become available.
E.Future methods can be called from within another future method.
AnswersB, D

The @future annotation is mandatory to designate a method for asynchronous execution.

Why this answer

Future methods run asynchronously, must be annotated with @future, and cannot accept sObjects as arguments because sObject records can change between the time the method is called and when it executes.

163
MCQhard

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

A.Only the records that caused the exception are rolled back; successful records are committed.
B.The transaction pauses until the exception is manually resolved by an admin.
C.The records are saved, and an email is sent to the system administrator without rolling back.
D.The entire transaction is rolled back, and no changes are saved to the database.
AnswerD

Apex transactions are atomic; any unhandled exception causes a complete rollback.

Why this answer

An unhandled exception in any trigger causes the entire database transaction to roll back entirely.

164
MCQmedium

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

A.HAVING BY
B.GROUP BY
C.AGGREGATE BY
D.ORDER BY
AnswerB

GROUP BY is required when aggregating data by specific fields.

Why this answer

Aggregate queries in SOQL require the GROUP BY clause when using functions like SUM(), COUNT(), or AVG().

165
Multi-Selecthard

Which TWO of the following are limitations when deploying using the Metadata API?

Select 2 answers
A.Components must be defined in a package.xml manifest
B.It allows bypassing governor limits during deployment
C.Apex tests are automatically run during deployment to production
D.It can only be used for Apex Classes
E.It requires a manual review by Salesforce Support
AnswersA, C

A manifest is required for Metadata API.

Why this answer

Metadata API deployments require a manifest file and are subject to the same validation rules as the org.

166
Multi-Selectmedium

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

Select 2 answers
A.Blob
B.Id
C.List<String>
D.SObject
E.String
AnswersB, E

IDs are frequently used as map keys for sObject mapping.

Why this answer

Primitive data types like String, ID, and Integer can be used as map keys in Apex.

167
MCQeasy

A developer needs to write a unit test to verify that a trigger correctly inserts related Task records when a custom object record is created. Which annotation should the developer place on the test class method to ensure it runs correctly and can access existing org data if needed?

A.@ReadOnly
B.@TestVisible
C.@isTest
D.@TestSetup
AnswerC

The @isTest annotation is required on test classes and test methods to define them for execution.

Why this answer

The @isTest annotation identifies a method or class as containing unit tests. Using @isTest(SeeAllData=true) is sometimes required when legacy data must be accessed, though best practice is to create test data locally.

168
MCQeasy

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

A.Install Salesforce CLI
B.Configure a Deployment Connection
C.Enable Metadata API in production
D.Create an Unmanaged Package
AnswerB

Deployment connections are mandatory for moving Change Sets between environments.

Why this answer

A Deployment Connection must be established between the two organizations before a Change Set can be sent.

169
Multi-Selectmedium

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.)

Select 2 answers
A.Place DML statements inside 'for' loops to ensure immediate database commits.
B.Use the 'webservice' keyword on helper methods called by triggers.
C.Execute a separate SOQL query for every single record in Trigger.new.
D.Use trigger context variables like Trigger.new to process records in bulk.
E.Perform SOQL queries and DML operations outside of loops.
AnswersD, E

Trigger context variables hold collections of sObjects, allowing batch processing of records.

Why this answer

Triggers must be bulkified to handle collections of records and queries/DML operations must be kept outside loops.

170
Multi-Selectmedium

A developer is designing a Lightning Web Component that needs to communicate with another component located anywhere in the application hierarchy, including unrelated components. Which TWO mechanisms are valid and appropriate for this requirement? Choose 2 answers.

Select 2 answers
A.A shared pub/sub utility module imported into both components
B.Aura Application Events
C.Lightning Message Service (LMS)
D.Direct parent-to-child property passing via public properties (@api)
E.Standard DOM CustomEvent with bubbles set to true
AnswersA, C

Correct. A custom pub/sub utility using EventTarget or custom events allows decoupled components to communicate.

Why this answer

Lightning Message Service (LMS) and custom PubSub patterns built on top of standard browser events or custom event dispatchers are suited for communication across unrelated components.

171
MCQeasy

Which trigger context variable should be used to check if a trigger is running in a before-insert context?

A.Trigger.isBeforeInsert
B.Trigger.isBefore && Trigger.isInsert
C.Trigger.context == 'beforeInsert'
D.Trigger.beforeInsert
AnswerB

These variables correctly identify the context.

Why this answer

Trigger.isBefore and Trigger.isInsert are standard context variables.

172
MCQmedium

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)?

A.lightning__AppPage
B.lightning__GlobalAction
C.lightning__RecordPage
D.lightning__UtilityBar
AnswerC

Enables the component for record pages.

Why this answer

lightning__RecordPage target enables a component to be placed on record pages.

173
MCQmedium

A developer needs to ensure that a custom Apex controller safely checks whether the current user has read access to the 'Salary__c' field on the 'Employee__c' object before displaying it in a Lightning Web Component. Which method should the developer use?

A.Employee__c.Salary__c.getDescribe().isCreateable()
B.User.hasReadAccess('Employee__c', 'Salary__c')
C.Schema.sObjectType.Employee__c.fields.Salary__c.isAccessible()
D.ApexPages.currentPage().getParameters().get('Salary__c')
AnswerC

The isAccessible() method on the field describe result returns true if the current user has read access to the field.

Why this answer

The Security class and sObjectDescribe methods provide mechanisms to check CRUD and FLS in Apex before querying or displaying data.

174
MCQhard

A developer wrote a batch job that encounters unhandled exceptions on specific records. To ensure that processing of other records continues despite errors in a chunk, what parameter should be configured in the start method or execution?

A.Database.allowsCallouts
B.System.abortJob()
C.Database.upsert with allOrNone set to false
D.Database.rollback()
AnswerC

Setting allOrNone to false during DML operations in batch allows partial success and failure logging.

Why this answer

Using Database.executeBatch with the default scope or handling exceptions within the execute method using try/catch ensures successful records are committed while failed ones can be logged.

175
MCQeasy

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

A.200
B.100
C.50000
D.50
AnswerB

Salesforce permits a maximum of 100 SOQL queries in a synchronous transaction.

Why this answer

The synchronous governor limit for SOQL queries is 100.

176
Multi-Selectmedium

Which THREE items are valid considerations when designing Batch Apex?

Select 3 answers
A.The execute method accepts a list of SObjects
B.The finish method is optional
C.Batch apex can be called from a trigger synchronously
D.The start method returns a QueryLocator or Iterable
E.Governor limits are reset for each execute method call
AnswersA, D, E

This is required for the execute method.

Why this answer

Batch Apex requires start, execute, and finish methods and is subject to specific heap and query limits.

177
MCQhard

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?

A.UserInfo.setUserId()
B.Database.setSavepoint()
C.Test.setCurrentUser()
D.System.runAs()
AnswerD

System.runAs allows block-level execution under a specified User instance to test sharing behavior.

Why this answer

System.runAs() enables developers to run test methods under a specific user context to verify record-level security and sharing rules.

178
MCQeasy

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

A.<apex:stylesheet>
B.<link rel="stylesheet" ...>
C.<apex:css>
D.<apex:style>
AnswerA

Includes a stylesheet in the page.

Why this answer

<apex:stylesheet> is used to include external CSS files in Visualforce.

179
MCQeasy

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?

A.protected static
B.public static final
C.private volatile
D.global transient
AnswerB

'static' associates the variable with the class, and 'final' ensures it acts as a constant once initialized.

Why this answer

Constants in Apex are defined using the 'static' and 'final' keywords to ensure they belong to the class and cannot be modified.

180
MCQmedium

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?

A.ApexPages.addMessage()
B.Record.addError()
C.Trigger.addError()
D.System.assert()
AnswerB

addError() prevents the DML operation and displays an error message on the record or page.

Why this answer

To prevent a record from saving in a before trigger, the developer must use the addError() method on the sObject record instance.

181
MCQmedium

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?

A.lightning-input
B.apex:outputText
C.ui:outputCurrency
D.lightning-formatted-number
AnswerD

Supports currency formatting based on user locale.

Why this answer

lightning-formatted-number with format-style="currency" or lightning-formatted-text is used for formatting.

182
MCQmedium

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

A.The test is skipped by the compiler.
B.The compiler issues a warning.
C.The test passes if the code executes without errors.
D.The test fails immediately.
AnswerC

Tests require assertions to be meaningful.

Why this answer

The test will pass as long as the code runs without error, but it is not a valid test.

183
MCQeasy

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?

A.Lightning Component Tab
B.Visualforce Tab
C.Object Tab
D.Web Tab
AnswerA

Correct because Lightning Component Tabs expose LWC to the App Launcher and navigation menus.

Why this answer

Lightning component tabs allow Lightning Web Components and Aura components to be exposed as tabs.

184
MCQhard

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?

A.Bind the child method to a public @api property on the parent.
B.Fire an application event from the parent to the child.
C.Use document.getElementById() to find the child element.
D.Invoke the method directly on the child element reference obtained via template.querySelector().
AnswerD

Public child methods are callable directly from the parent via the component reference.

Why this answer

Public methods on child components must be decorated with @api and invoked via this.template.querySelector().methodName().

185
MCQeasy

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

A.Higher governor limits
B.Declarative configuration
C.Access to private methods
D.Better performance
AnswerB

Declarative tools reduce technical debt and maintenance.

Why this answer

Flows are declarative, easier to maintain, and require no code, making them faster to deploy.

186
Multi-Selectmedium

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

Select 2 answers
A.Trigger.old is available in update and delete triggers.
B.Trigger.new is available in insert, update, and undelete triggers.
C.Trigger.old is available in insert and update triggers.
D.Trigger.new records are always read-only in before triggers.
E.Trigger.newMap is available in before insert triggers.
AnswersA, B

Trigger.old holds pre-update and pre-delete record states.

Why this answer

Trigger.new is available on insert, update, and undelete. Trigger.old is available on update and delete.

187
MCQeasy

Which of the following is a limitation of Change Sets?

A.They cannot deploy Custom Objects
B.They are limited to 100 components
C.They require the CLI to be installed
D.They can only be used between related orgs
AnswerD

Change Sets require a deployment connection between the source and target orgs.

Why this answer

Change Sets are strictly one-way and cannot be used to deploy changes from production back to a sandbox.

188
Multi-Selecteasy

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

Select 3 answers
A.Queue
B.Set
C.Table
D.List
E.Map
AnswersB, D, E

Set is a fundamental collection type in Apex.

Why this answer

Apex provides three built-in collection types: List, Set, and Map.

189
MCQeasy

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

A.Queueable Apex allows passing sObjects and custom Apex types as member variables.
B.Queueable Apex executes synchronously on the user thread.
C.Queueable Apex has no governor limits.
D.Queueable Apex cannot make callouts.
AnswerA

Unlike future methods which only accept primitives, Queueable Apex accepts complex sObjects and collections.

Why this answer

Queueable Apex supports non-primitive data types and job chaining.

190
MCQeasy

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?

A.SLDS standard spacing utility classes.
B.Inline styles directly in the HTML template.
C.Standard HTML blockquote tags with custom margin properties.
D.Hardcoded pixel values in the component's CSS file.
AnswerA

Correct because SLDS utility classes provide consistent, standardized spacing.

Why this answer

SLDS provides predefined design tokens and CSS utility classes (such asslds-m-around_medium) for consistent spacing.

191
MCQeasy

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?

A.Queueable Apex
B.Schedulable Apex
C.Future methods
D.Batch Apex
AnswerA

Queueable Apex supports non-primitive types and provides job chaining via System.enqueueJob.

Why this answer

Queueable Apex supports the Database.AllowsCallouts interface, allows chaining of jobs, and accepts member variables of non-primitive types such as custom objects.

192
MCQeasy

A developer needs to execute logic after a record is inserted into the database but before the database commits the transaction. Which trigger event is most appropriate?

A.before insert
B.after insert
C.before update
D.after update
AnswerB

after insert is used for post-processing and accessing the record ID.

Why this answer

The after insert trigger event executes after the record is saved to the database but before the final commit.

193
MCQmedium

A developer has created a custom Aura component that needs to be embedded within a Lightning Web Component. What is the correct rule regarding component composition between Aura and LWC?

A.LWC can directly contain Aura components in its markup.
B.Neither framework can consume components from the other framework.
C.Aura components can contain Lightning Web Components in their markup.
D.Both frameworks can freely nest each other without restrictions.
AnswerC

Correct because Aura components support embedding Lightning Web Components.

Why this answer

An LWC can contain an Aura component, provided the Aura component is wrapped or referenced according to framework rules, but Aura cannot directly contain arbitrary LWC without proper wrapping. Wait, actually, LWC can contain Aura components? No, LWC can contain Aura components ONLY if they are wrapped, but more precisely, Aura components CAN contain LWC. Let's verify: Aura can contain LWC, but LWC cannot contain Aura directly.

Let's adjust the options.

194
Multi-Selecteasy

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

Select 2 answers
A.Flows execute entirely on client-side browsers.
B.Flows provide a visual canvas for building automation logic without writing code.
C.Flows require compilation into bytecode and deployment via metadata APIs or developer toolchains.
D.Flows allow administrators to debug executions using built-in visual debugging tools.
E.Flows cannot interact with custom objects or custom fields.
AnswersB, D

Flow Builder is a visual drag-and-drop tool for declarative automation.

Why this answer

Flow Builder is declarative, provides visual debugging, and allows point-and-click creation.

195
MCQmedium

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?

A.InstallHandler
B.Schedulable
C.Database.Batchable
D.HttpCalloutMock
AnswerD

HttpCalloutMock must be implemented to return fake responses since actual callouts are not permitted in test methods.

Why this answer

HttpCalloutMock is the interface implemented to supply a mock HTTP response during test context when callouts are made.

196
MCQeasy

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

A.Validation Rules
B.Record-Triggered Flow
C.Assignment Rules
D.Approval Processes
AnswerB

Record-triggered flows can create and update related records declaratively.

Why this answer

Record-triggered flows in Flow Builder allow declarative creation of related records.

197
MCQmedium

A developer needs to call an external web service from an Apex trigger. Why must this be done asynchronously?

A.To increase governor limits for DML
B.Because triggers are limited to 10 callouts
C.To prevent callouts from blocking the transaction
D.To allow the trigger to run faster
AnswerC

Salesforce prevents synchronous callouts in triggers to ensure transaction integrity.

Why this answer

DML operations and external callouts cannot be mixed in the same transaction; callouts require asynchronous processing.

198
MCQmedium

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

A.Apex Code.
B.Database.
C.Profiling.
D.Workflow.
AnswerC

Profiling provides memory and resource usage data.

Why this answer

The Profiling category provides detailed information on resource consumption.

199
MCQeasy

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

A.constructor()
B.connectedCallback()
C.renderedCallback()
D.render()
AnswerC

Correct because renderedCallback runs after every render cycle.

Why this answer

renderedCallback() is called after every render of the component, useful for post-rendering DOM manipulation.

200
Multi-Selecthard

Which THREE statements are accurate regarding asynchronous Apex governor limits and best practices? (Choose three.)

Select 3 answers
A.Asynchronous Apex transactions have higher limits for SOQL queries and heap size compared to synchronous transactions.
B.Batch Apex scope size can be customized from 1 to 2000 records.
C.Future methods can call other future methods recursively.
D.Infinite chaining of Queueable jobs without exit conditions can exhaust daily asynchronous limits.
E.Asynchronous Apex jobs execute immediately without waiting in a queue.
AnswersA, B, D

Correct. Asynchronous transactions generally receive higher governor limits.

Why this answer

Asynchronous Apex provides higher governor limits, but developers must avoid chaining loops and respect daily limits.

201
MCQmedium

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

A.System.log().
B.Apex.debug().
C.System.debug().
D.Log.info().
AnswerC

Correct method for adding logs.

Why this answer

System.debug() is used to add custom messages to the debug log.

202
MCQeasy

Which collection method is used to add all elements from one Set into another Set in Apex?

A.addAll()
B.merge()
C.combine()
D.putAll()
AnswerA

addAll() adds all elements of a collection to the target set.

Why this answer

The addAll() method is available on Set, List, and Map collections to add multiple elements at once.

203
MCQmedium

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?

A.Creating a task for the record owner upon lead conversion
B.Updating a field on a related parent record when a child record is created
C.Sending a standard email alert when a picklist value changes
D.Performing sequential HTTP callouts and complex JSON parsing in response to record inserts
AnswerD

Apex natively handles complex callout chaining and exception handling better than declarative flows.

Why this answer

Complex integrations, callouts, and heavy algorithmic processing across multiple disparate objects often necessitate Apex triggers over declarative flows.

204
MCQhard

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?

A.Use Database.upsert with strict mode enabled inside the trigger loop.
B.Query the database inside a for loop for every record in Trigger.new.
C.Collect the external ID values into a Set, query once outside the loop, and use a Map for validation.
D.Use an asynchronous @future method to validate duplicates after insert.
AnswerC

This is fully bulkified and avoids governor limit violations.

Why this answer

Collecting field values into a Set, querying existing records matching that Set in a single query outside of loops, and comparing in memory is the bulkified approach.

205
Multi-Selecthard

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

Select 3 answers
A.Executing nested loops over large collections of sObjects.
B.Running complex string manipulations or regular expression matching on large text bodies.
C.Invoking too many SOQL queries within the 100 query limit.
D.Exceeding the total number of allowed DML statements.
E.Executing heavy calculations inside triggers processing large bulk record batches.
AnswersA, B, E

Nested loops with high iteration counts rapidly consume CPU time.

Why this answer

Heavy loops, complex triggers, inefficient nested queries or collections processing, and excessive regex or string manipulations contribute to CPU time exhaustion.

206
MCQmedium

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?

A.Queueable Apex
B.Batch Apex
C.Future methods
D.Scheduled Apex
AnswerB

Batch Apex allows processing of millions of records using Database.Batchable and custom batch sizes up to 2,000.

Why this answer

Batch Apex is designed for processing large datasets in chunks asynchronously.

207
MCQmedium

A developer is configuring a Lightning Web Component metadata file to allow the component to be placed on a FlexPage. Which tag defines the configuration regions or design properties?

A.Inside the component-name.html template using special attribute tags.
B.Using global variables in the component's JavaScript controller file.
C.A separate component-name.design file in the bundle.
D.Inside the component-name.js-meta.xml file under the <design> tag.
AnswerC

Correct because design files define attributes exposed in the Lightning App Builder.

Why this answer

The <masterLabel> and <targets> are used, but design properties are defined in a separate design file (.design). Wait, configuration regions for App Builder properties are defined in the .design file for Aura, but in LWC design properties are also in a .design file. Let's frame the question around design files.

208
MCQeasy

A developer needs to invoke a long-running external web service callout from an existing scheduled Apex job that implements the Schedulable interface. What is the correct approach to implement this callout?

A.Mark the Schedulable execute method with the @future(callout=true) annotation.
B.Implement Database.AllowsCallouts directly in the Schedulable class and execute the callout inside the execute method.
C.Enquie a Queueable Apex class that implements Database.AllowsCallouts from within the Schedulable execute method.
D.Invoke the external web service using a standard synchronous SOQL statement.
AnswerC

Correct. Enqueueing a Queueable job that implements Database.AllowsCallouts allows callouts to be made successfully from scheduled contexts.

Why this answer

Schedulable Apex cannot directly make synchronous callouts because the thread must wait for the network response. Developers must chain a Queueable class that implements Database.AllowsCallouts.

209
Multi-Selecthard

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.)

Select 2 answers
A.Batch Apex chunks automatically roll back entirely if a single record fails, regardless of DML settings.
B.Using Database.DMLOptions or Database.insert(list, false) enables partial processing of records within a chunk without failing the entire batch.
C.Implementing the Database.Stateful interface allows instance variables to retain their values between batch chunks.
D.Batch Apex jobs cannot be monitored programmatically via Apex code.
E.The finish method executes before all execute chunks have completed.
AnswersB, C

Using partial DML allows successful records in the chunk to commit while failing ones are logged.

Why this answer

Using Database.insert(records, false) allows partial success within a batch chunk, and state can be maintained across chunks if Database.Stateful is used.

210
Multi-Selecthard

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.)

Select 2 answers
A.Execution of Before Triggers.
B.Execution of custom validation rules
C.Execution of Assignment Rules and Escalation Rules.
D.Execution of initial system validation (such as required field checks).
E.Execution of Record-Triggered After Flows and Apex After Triggers.
AnswersC, E

Assignment and escalation rules run after validation and before after-triggers.

Why this answer

After triggers and assignment rules occur after custom validation rules in the save order of execution.

211
MCQmedium

A developer is creating a Lightning Web Component that needs to display a list of Accounts. The developer wants to fetch the data imperatively when a user clicks a button rather than automatically via a wire adapter. What is the correct approach?

A.Use the @api track decorator on the Apex method call inside the template.
B.Use the @wire decorator on an imported Apex method and update a reactive property.
C.Configure the component metadata file to fetch the data imperatively on load.
D.Call the imported Apex method as a JavaScript function inside the button's event handler and handle the returned promise.
AnswerD

Correct because imperative Apex is called as a function returning a promise inside an event handler.

Why this answer

Imperative Apex calls are invoked as standard JavaScript promises, typically triggered by an event handler such as a button click.

212
MCQmedium

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?

A.String
B.Boolean
C.PicklistEntry
D.Integer
AnswerA

Picklist values are represented as String types in Apex sObject assignments.

Why this answer

Picklist fields in Salesforce are represented as Strings in Apex when assigned or retrieved via sObjects.

213
Multi-Selecthard

Which THREE limitations apply when writing Future methods in Apex? (Choose three.)

Select 3 answers
A.Future methods cannot accept sObjects or custom non-primitive data types as parameters.
B.Future methods return an AsyncApexJob ID immediately upon invocation.
C.Future methods cannot be used if the caller is already executing in an asynchronous context (e.g., inside a batch or queueable job).
D.Future methods execute asynchronously when system resources become available.
E.Future methods can be called synchronously from within another future method.
AnswersA, C, D

Future methods only accept primitive data types or collections of primitives.

Why this answer

Future methods cannot accept sObjects, cannot be tracked easily with job IDs, and cannot be called from other future methods.

214
Multi-Selecthard

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

Select 3 answers
A.Salesforce CLI (sf apex run)
B.Standard Page Layout Editor
C.Developer Console
D.Salesforce Extensions for Visual Studio Code
E.Lightning App Builder
AnswersA, C, D

SF CLI supports running anonymous apex scripts.

Why this answer

Anonymous Apex can be executed via the Developer Console, Salesforce Extensions for VS Code, and Salesforce CLI (sf apex run).

215
MCQeasy

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?

A.Test.resetLimits()
B.Test.runAs()
C.Test.startTest()
D.Limits.reset()
AnswerC

Test.startTest() marks the point when test execution begins and resets governor limits.

Why this answer

Test.startTest() and Test.stopTest() bracket the test section, resetting governor limits for the execution block within them and forcing any asynchronous calls to run synchronously.

216
MCQhard

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

A.Trigger.old
B.Trigger.oldMap
C.Trigger.map
D.Trigger.newMap
E.Trigger.new
AnswerA

Trigger.old holds the previous versions of the records.

Why this answer

Trigger.old contains the list of records before the update or deletion.

217
MCQeasy

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?

A.Use standard SLDS utility classes directly in the component's HTML template.
B.Import the full SLDS stylesheet explicitly as a static resource.
C.Apply standard Bootstrap classes to match Salesforce themes.
D.Use inline styles exclusively for all components.
AnswerA

SLDS classes are available by default in Salesforce environments.

Why this answer

LWC natively incorporates SLDS styling when using standard base components, but custom styling should use standard SLDS CSS utility classes.

218
MCQmedium

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?

A.Total number of SQL queries issued (100)
B.Total heap size (6 MB)
C.Total number of records retrieved by SOQL queries (50,000)
D.Total CPU time (10,000 milliseconds)
AnswerA

Placing a SOQL query inside a loop causes a query to run for every record in the batch, hitting the 100 SOQL query limit.

Why this answer

Querying inside loops easily exhausts the total SOQL queries issued per transaction limit of 100.

219
Multi-Selecteasy

Which TWO statements about Apex variables and initialization are true? Choose 2 options.

Select 2 answers
A.Every variable in Apex must be explicitly declared with its data type.
B.Unassigned primitive variables are automatically initialized to null.
C.Integer variables default to 1 if unassigned.
D.Apex supports dynamic duck typing without variable declarations.
E.Boolean variables default to true if unassigned.
AnswersA, B

Apex is a strongly typed language requiring explicit data type declarations.

Why this answer

Unassigned primitive variables default to null, and variables must be declared with a type before use.

220
MCQhard

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?

A.Immediately when the line invoking the @future method is reached
B.At the end of the test method automatically without needing Test.stopTest()
C.After the Test.stopTest() method is executed
D.In a separate transaction concurrently while the test method continues running
AnswerC

Test.stopTest collects all asynchronous processes and runs them synchronously before resuming test execution.

Why this answer

Asynchronous methods called in tests are queued and executed synchronously after the Test.stopTest() statement.

221
Multi-Selecthard

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.)

Select 3 answers
A.Use a Debug Level configuration to define the verbosity for individual log categories.
B.Adjust log levels for specific categories such as Database, Workflow, and Apex Code.
C.Configure a Trace Flag specifying the targeted user and a designated start/end time.
D.Modify the organization-wide default debug level in Company Information.
E.Set up Apex Logging levels directly inside custom metadata types.
AnswersA, B, C

Debug levels define the granularity of logs recorded per category.

Why this answer

Trace flags control log levels and duration for users, classes, or triggers. Log categories allow filtering verbosity.

222
MCQmedium

What is the maximum number of debug logs that can be stored per user?

A.1,000.
B.There is no limit on count, only total size.
C.50.
D.100.
AnswerB

Based on aggregate size.

Why this answer

There is a limit (typically 50MB per user, but logs are replaced).

223
MCQeasy

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?

A.Map<Id, Id>
B.Queue<Id>
C.List<Id>
D.Set<Id>
AnswerD

Sets inherently prevent duplicate entries and offer optimal performance for membership checks.

Why this answer

Sets in Apex store unique elements and provide very fast lookups by value using methods like contains().

224
Multi-Selecthard

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

Select 3 answers
A.Catching a DmlException inside a try-catch block.
B.Executing Database.insert(records, false) with partial failure.
C.Exceeding a governor limit such as SOQL query count.
D.A DML failure when allOrNone defaults to true (or standard DML syntax).
E.An unhandled exception occurring anywhere in the execution stack.
AnswersC, D, E

Governor limit violations immediately terminate and roll back transactions.

Why this answer

Unhandled exceptions, unhandled DML errors with allOrNone=true, and governor limit violations roll back the transaction.

225
MCQmedium

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

A.Create a single record in the test class.
B.Use a loop to create 250 test records and insert them.
C.Use @isTest(isParallel=true) to increase speed.
D.Execute the trigger from the Developer Console.
AnswerB

Inserting a collection of records is the standard way to test bulk DML operations.

Why this answer

Testing with a collection of records validates bulkification and prevents governor limit exceptions.

Page 2

Page 3 of 7

Page 4

All pages