Courseiva

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

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

Page 3

Page 4 of 7

Page 5
226
MCQmedium

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?

A.JSON.deserialize(jsonString, List<Account>.class)
B.String.valueOf(jsonString)
C.JSON.serialize()
D.JSON.parse()
AnswerA

This correctly parses the JSON string into a typed List of Accounts.

Why this answer

JSON.deserialize() or JSON.deserializeUntyped() are used to parse JSON, and JSON.deserialize(jsonString, TargetType.class) deserializes into strongly typed objects.

227
MCQmedium

A developer has written an Apex method that executes a SOQL query to retrieve all Contacts associated with an Account. The method needs to be invoked securely without bypassing the user's organization-wide defaults and sharing settings. How should the developer execute this query?

A.Include the 'WITH SECURITY_ENFORCED' clause in the SOQL query.
B.Define the class using the 'with sharing' keyword.
C.Execute the query within a @future method.
D.Use the Schema.describeSObjects method before querying.
AnswerB

Adding 'with sharing' to the class definition ensures that the executing user's sharing rules are enforced during SOQL operations.

Why this answer

By default, SOQL queries executed in Apex enforce user-level sharing rules unless the 'with sharing' keyword is explicitly omitted in a 'without sharing' class context.

228
MCQeasy

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?

A.containsKey()
B.hasKey()
C.contains()
D.exists()
AnswerA

containsKey() checks for the presence of a key and returns a boolean value.

Why this answer

The containsKey() method checks whether a specified key exists in a Map instance.

229
Multi-Selecteasy

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

Select 2 answers
A.Client-side reactive shadow DOM encapsulation.
B.Automatic compilation of TypeScript into native browser bytecode.
C.Automatic enforcement of CRUD and FLS when using standard controllers.
D.Real-time bidirectional WebSocket synchronization across all connected browser tabs.
E.Built-in view state management for form submission and page state tracking.
AnswersC, E

Correct because standard controllers automatically respect object and field permissions.

Why this answer

Visualforce provides automatic CRUD/FLS enforcement with standard controllers and built-in view state management.

230
MCQeasy

Where can a developer view the generated debug logs for an Apex execution in the Salesforce UI?

A.Setup > Monitor > Debug Logs
B.Setup > Deployment > Logs
C.Setup > Security > Audit Trail
D.Setup > Custom Code > Apex Settings
AnswerA

This is the correct navigation path for viewing logs.

Why this answer

Debug logs are accessible via the Setup menu under 'Debug Logs' or within the Developer Console.

231
MCQhard

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?

A.System.Security
B.Schema.DescribeFieldResult
C.UserInfo
D.ApexPages.StandardController
AnswerB

DescribeFieldResult provides methods to evaluate user access permissions on fields.

Why this answer

The Schema.DescribeFieldResult class provides methods like isAccessible() to check Field-Level Security (FLS) dynamically.

232
MCQeasy

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

A.throw new TriggerException()
B.ApexPages.addMessage()
C.addError()
D.rejectRecord()
AnswerC

addError() prevents the save operation and displays an error on the UI or API response.

Why this answer

The addError() method on an sObject instance prevents the DML operation and displays an error message.

233
MCQeasy

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

A.Checkpoints
B.Log Inspector
C.Query Editor
D.Anonymous Apex
AnswerB

Log Inspector allows in-depth analysis of debug logs.

Why this answer

The Logs tab in the Developer Console displays execution logs, and Log Inspector provides detailed analysis tools.

234
Multi-Selecthard

Which THREE best practices should a developer follow to avoid governor limits when writing SOQL queries in Apex? Choose 3 options.

Select 3 answers
A.Query only the specific fields needed rather than using SELECT *.
B.Avoid placing SOQL queries inside loops.
C.Use bind variables to parameterize query criteria.
D.Execute a separate SOQL query for every child record individually.
E.Always use SELECT FIELDS(ALL) to ensure all data is retrieved.
AnswersA, B, C

Selecting only required fields reduces heap usage and improves performance.

Why this answer

Best practices include avoiding queries inside loops, using bind variables, and querying only necessary fields.

235
MCQeasy

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

A.It is a browser-based IDE for developing in Salesforce.
B.It is used for deploying to production.
C.It is a tool for end-user reporting.
D.It is used for managing user permissions.
AnswerA

Primary purpose.

Why this answer

It is an integrated development environment for writing, debugging, and testing Apex.

236
MCQmedium

A developer is troubleshooting a Batch Apex job where records are failing to update intermittently due to record locking contention with concurrent updates. What is the recommended strategy to mitigate record locking?

A.Increase the batch size to the maximum of 2,000 to complete faster.
B.Process records in smaller batch sizes and ensure parent records are sorted or processed in a deterministic order.
C.Convert the batch job into a synchronous trigger.
D.Disable all validation rules on the object permanently.
AnswerB

Smaller batch sizes reduce the window of record locks held simultaneously.

Why this answer

Sorting records in the start method query using FOR UPDATE or structuring batches by parent groups can reduce locking, and processing smaller batch sizes can also help.

237
MCQeasy

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?

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

Correct. Before insert triggers execute before the record is saved to the database, making them ideal for validation and field updates.

Why this answer

Before insert triggers are used to perform validation, update field values, and prevent records from saving by using the addError() method on the records.

238
Multi-Selectmedium

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

Select 3 answers
A.The class must extend the Controller class.
B.The class must implement Database.Batchable<SObject>.
C.The public class must implement the Schedulable interface.
D.The job must be invoked using System.schedule() with a valid Cron expression.
E.The class must define the global or public void execute(SchedulableContext sc) method.
AnswersC, D, E

Implementation of the Schedulable interface is mandatory.

Why this answer

Schedulable Apex requires implementing the Schedulable interface, defining the execute method, and scheduling via System.schedule with a Cron expression.

239
MCQmedium

A developer wants to prevent sensitive fields from being included in the Visualforce view state to reduce size. Which keyword should be added to the field declaration in the controller?

A.private
B.static
C.transient
D.final
AnswerC

Excludes variables from the Visualforce view state.

Why this answer

transient keyword prevents variables from being saved in the view state.

240
MCQmedium

In the Salesforce order of execution, when are assignment rules evaluated relative to Apex triggers?

A.Concurrently with workflow rules.
B.After all triggers have completely finished.
C.Before any triggers execute.
D.After Before Triggers and before After Triggers.
AnswerD

Assignment rules are processed after before triggers and standard validation rules.

Why this answer

Assignment rules run after the insert or update before triggers and standard validations, but before after triggers.

241
Multi-Selectmedium

Which TWO configuration files or metadata elements are required when creating a Lightning Web Component? Choose 2 answers.

Select 2 answers
A.A CSS stylesheet (.css)
B.A JavaScript file (.js)
C.An Apex controller class
D.A metadata configuration file (.js-meta.xml)
E.An Aura dependency bundle (.auradoc)
AnswersB, D

Defines component logic and class.

Why this answer

Every LWC requires an HTML template file and a metadata configuration XML file.

242
MCQeasy

Which Salesforce data model relationship type allows two objects to have a many-to-many relationship through a junction object?

A.Hierarchical Relationship
B.Master-Detail Relationship
C.Lookup Relationship
D.External Relationship
AnswerB

A junction object uses two Master-Detail relationships to connect two parent objects in a many-to-many relationship.

Why this answer

Master-Detail relationships on a junction object pointing to two parent objects establish a many-to-many relationship.

243
MCQmedium

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

A.Using too many debug statements.
B.Not enough test coverage.
C.Using the wrong trigger event.
D.Executing SOQL inside a for loop.
AnswerD

This hits the query limit quickly.

Why this answer

Performing SOQL inside a loop is the primary cause of this error.

244
MCQmedium

In an after insert trigger on the Account object, a developer attempts to modify a field on Trigger.new[0] and performs an update DML statement. What happens?

A.The transaction is rolled back due to governor limits.
B.A System.SObjectException is thrown because Trigger records are read-only in after triggers.
C.The trigger fires infinitely without stopping.
D.The record updates successfully without issues.
AnswerB

Trigger records in after triggers cannot be modified directly without re-querying or instantiating a new sObject instance for DML.

Why this answer

Modifying Trigger.new records in an after trigger and running DML causes a read-only exception or recursive trigger loop.

245
MCQhard

A developer writes a trigger that calls a future method. Inside the same transaction, the trigger also performs a DML operation on records that are referenced by the future method. What exception might occur?

A.System.AsyncException due to calling a future method from another asynchronous context or batch
B.System.LimitException due to query row limits
C.System.NullPointerException
D.System.TypeException
AnswerA

Future methods cannot call other future methods or be called from batch/scheduled contexts in certain nested ways.

Why this answer

Passing sObject IDs to a future method when the underlying records are locked or modified rapidly in mixed DML or same-transaction contexts can lead to System.AsyncException or unexpected state issues, though specifically mixed DML involves setup and non-setup objects.

246
Multi-Selecteasy

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

Select 2 answers
A.Write complex multi-object business logic with custom SQL-like joins.
B.Perform standard save, delete, and cancel database operations without writing custom Apex code.
C.Instantiate custom web service callouts automatically.
D.Access field values of the record being viewed or edited.
E.Override standard page layouts without any configuration.
AnswersB, D

Standard controller built-in actions handle standard DML.

Why this answer

Standard controllers allow basic DML operations like save and delete, and provide access to record fields.

247
MCQeasy

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

A.50
B.200
C.100
D.500
AnswerC

Synchronous transactions allow a maximum of 100 SOQL queries.

Why this answer

The synchronous governor limit for SOQL queries is 100 queries per transaction.

248
MCQeasy

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

A.slds-grid
B.slds-m-around_medium
C.slds-padding_medium
D.slds-margin-all
AnswerB

Applies a medium margin around all sides of an element.

Why this answer

SLDS spacing classes follow the pattern slds-m-{sides}-{size}.

249
MCQeasy

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

A.Force.com IDE.
B.Change Sets.
C.Salesforce CLI.
D.Metadata API.
AnswerB

Change Sets provide a UI for moving metadata between linked Orgs.

Why this answer

Change Sets are designed for moving metadata between linked Salesforce Orgs.

250
MCQeasy

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

A.The deployment fails entirely.
B.The class is deployed without the code.
C.The class is deployed with warnings.
D.The class is skipped.
AnswerA

Deployment is transactional.

Why this answer

Compilation errors prevent deployment.

251
Multi-Selecteasy

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)

Select 2 answers
A.getAccountList from 'lightning/accountApi'
B.getRecordUi from 'lightning/uiRecordApi'
C.getRecord from 'lightning/uiRecordApi'
D.fetchRecord from 'lightning/recordStore'
E.queryDatabase from 'lightning/database'
AnswersB, C

Correct because getRecordUi is a standard LDS wire adapter for layout and record data.

Why this answer

getRecord and getRecordUi are standard wire adapters provided by lightning/uiRecordApi for working with Salesforce records.

252
MCQeasy

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?

A.controller="Account"
B.object="Account"
C.recordId="Account"
D.standardController="Account"
AnswerD

Correct because standardController specifies the object context.

Why this answer

The standardController attribute binds a Visualforce page to a standard Salesforce object.

253
Multi-Selectmedium

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

Select 2 answers
A.Modifying field values on records in Trigger.new directly without a DML statement.
B.Accessing Trigger.oldMap to compare previous values.
C.Performing an immediate synchronous HTTP callout to an external REST service.
D.Executing an explicit update DML statement on records in Trigger.new.
E.Calling the addError() method on a record in Trigger.new to prevent saving.
AnswersA, E

Before triggers are specifically designed to update field values on the same records in memory without explicit DML.

Why this answer

Before insert triggers allow modifying field values on Trigger.new directly and adding errors via addError(). DML statements and sending emails require after context or incur exceptions/limit issues.

254
MCQhard

A developer creates a custom Lightning Web Component that includes a wired property to retrieve account records. The component needs to react dynamically when the record data is updated via another component on the page. Which decorator should be used on the JavaScript property to receive reactive updates?

A.@api
B.@wire
C.@track
D.@readonly
AnswerB

@wire connects a property or function to a Salesforce wire service adapter, updating reactively when underlying data changes.

Why this answer

The @wire decorator in Lightning Web Components provisions a stream of data to a property or function reactively.

255
Multi-Selecthard

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)

Select 3 answers
A.Using a .catch(error => { ... }) block on the returned promise.
B.Using try/catch blocks with asynchronous/await syntax when calling imperative Apex.
C.Reading error.stackTrace to automatically rollback database transactions on the client.
D.Calling error.retry() to automatically re-execute the failed database transaction.
E.Inspecting error.body.message to retrieve the specific error message thrown by Apex.
AnswersA, B, E

Correct because imperative Apex returns a promise that uses .catch for error handling.

Why this answer

Imperative Apex returns promises where errors can be caught in .catch(), inspected via error.body.message, or handled via standard JavaScript error objects.

256
MCQhard

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?

A.Approval.lock()
B.System.createCheckpoint()
C.Database.Savepoint sp = Database.setSavepoint();
D.Database.beginTransaction()
AnswerC

Savepoints allow partial rollbacks within a transaction.

Why this answer

Database.setSavepoint() creates a savepoint, and Database.rollback() rolls back changes to that savepoint.

257
MCQmedium

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

A.It makes tests dependent on the state of the organization's existing data.
B.It prevents the use of Test.startTest().
C.It causes the Apex compiler to error.
D.It increases the test execution time significantly.
AnswerA

This leads to 'brittle' tests that fail if data changes.

Why this answer

It relies on existing organization data, making tests brittle and dependent on external state.

258
MCQhard

When using a @future method, what data type is allowed as a parameter?

A.SObject
B.String
C.Apex Class instance
D.List of SObjects
AnswerB

Primitive types like String are supported.

Why this answer

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

259
Multi-Selectmedium

Which THREE statements are true regarding Salesforce debug logs? (Choose three.)

Select 3 answers
A.Debug logs can capture database operations, Apex code execution, and workflow rule evaluations.
B.Developers cannot view debug logs inside the Salesforce Developer Console.
C.Trace flags are required to specify log levels and duration for users, classes, or triggers.
D.A single debug log file has a maximum size limit, beyond which older log lines are dropped or truncated.
E.Debug logs are stored indefinitely in production without automatic purging.
AnswersA, C, D

Debug logs track multiple categories including Database, ApexCode, and Workflow.

Why this answer

Debug logs capture system events, have size limits, and require trace flags.

260
MCQhard

A developer needs to reset the governor limits within a test method to verify functionality that processes large amounts of records. Which method should be used?

A.System.resetLimits()
B.Test.loadData()
C.Test.startTest()
D.Test.stopTest()
AnswerC

Test.startTest() resets limits, and the code following Test.stopTest() is executed with fresh limits.

Why this answer

Test.startTest() and Test.stopTest() reset the governor limits for the code executed between them.

261
Multi-Selecthard

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)

Select 3 answers
A.Use primitive data types or simple serializable wrapper classes for parameters and return values.
B.Ensure Apex methods enforce object and field-level security (FLS) where appropriate.
C.Mark all Apex controller methods as global to allow unrestricted LWC access.
D.Annotate read-only methods with @AuraEnabled(cacheable=true) to improve performance.
E.Pass entire sobject records with complex parent relationships directly from client-side JavaScript without validation.
AnswersA, B, D

Correct because LWC requires serializable primitives or wrapper structures.

Why this answer

Apex methods for LWC should be cacheable when read-only, handle security/sharing properly, and accept appropriate parameter types.

262
Multi-Selectmedium

A developer is designing a complex data validation and transformation process. Which TWO scenarios are best implemented using an Apex Trigger rather than a Record-Triggered Flow? (Choose TWO.)

Select 2 answers
A.Sending a standard email notification template when a status changes.
B.Updating a simple custom field on the same record before it is saved.
C.Executing complex custom algorithms requiring recursive method calls and dynamic exception handling across multiple wrapper classes.
D.Making asynchronous REST callouts to an external validation service during record creation.
E.Creating a task for a lead owner upon lead assignment.
AnswersC, D

Heavy programmatic logic and custom wrapper classes require Apex.

Why this answer

Apex triggers excel at complex integrations (callouts) and custom exception handling across multiple distinct object hierarchies that exceed declarative flow capabilities.

263
MCQhard

A developer needs to determine if the current user has delete permissions on the Opportunity object in Apex before calling a deletion method. Which method should be used?

A.User.hasPermission('Opportunity', 'Delete')
B.System.hasDeleteAccess(Opportunity.class)
C.Schema.sObjectType.Opportunity.isDeletable()
D.Opportunity.sObjectType.getDescribe().isDeletable()
AnswerC

Schema.sObjectType.Opportunity.isDeletable() correctly verifies object-level delete permissions.

Why this answer

Schema.sObjectType.Opportunity.isDeletable() checks if the current user has delete permission on the Opportunity object.

264
MCQmedium

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

A.By inspecting the trigger size.
B.By reviewing the debug log for query execution times.
C.By checking the number of records returned.
D.By counting the number of lines in the code.
AnswerB

Logs capture duration.

Why this answer

By checking the 'Executed Units' or 'SOQL' section of the debug log for duration.

265
MCQmedium

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

A.To export logs.
B.To run tests.
C.To limit the types of events displayed.
D.To delete old logs.
AnswerC

Primary purpose.

Why this answer

It allows developers to focus on specific categories or levels of logs.

266
Multi-Selecteasy

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

Select 2 answers
A.All asynchronous queued processes (future, batch, queueable) are run synchronously.
B.The user session is automatically logged out.
C.All custom objects in the organization are deleted and recreated.
D.Email messages and other pending asynchronous communications are dispatched.
E.The database is permanently committed to production.
AnswersA, D

StopTest forces all asynchronous processes to execute before proceeding.

Why this answer

Test.stopTest() executes asynchronous jobs and processes pending communications.

267
MCQmedium

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

A.String.toInteger()
B.Convert.toInteger()
C.Integer.valueOf()
D.Integer.parse()
AnswerC

valueOf() parses strings into numeric primitives.

Why this answer

Integer.valueOf() converts a String representation of a number into an Integer primitive.

268
MCQeasy

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

A.getNumElements()
B.size()
C.length()
D.count()
AnswerB

size() returns the element count for collections.

Why this answer

The size() method returns the number of elements in a List, Set, or Map in Apex.

269
MCQmedium

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?

A.standard__recordPage
B.standard__webPage
C.standard__namedPage
D.standard__objectPage
AnswerB

Used for external URLs.

Why this answer

standard__webPage is the PageReference type for navigating to external URLs or web pages.

270
Multi-Selecteasy

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

Select 2 answers
A.Char
B.Structure
C.Array
D.Integer
E.Boolean
AnswersD, E

Integer is a valid Apex primitive.

Why this answer

Integer and Boolean are native primitive data types in Apex, whereas Array and Structure are not standalone primitive types.

271
Multi-Selecteasy

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

Select 2 answers
A.renderedCallback
B.init
C.connectedCallback
D.componentDidMount
E.willMount
AnswersA, C

Invoked after every render of the component.

Why this answer

connectedCallback and renderedCallback are standard LWC lifecycle hooks.

272
MCQmedium

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?

A.verify()
B.checkValidity()
C.isValid()
D.validate()
AnswerB

Checks if the input satisfies validity constraints.

Why this answer

checkValidity() evaluates validity and reports validity status on input components.

273
Multi-Selectmedium

When deploying code using Unmanaged Change Sets between connected Salesforce organizations, which TWO limitations or behaviors apply? (Choose two.)

Select 2 answers
A.Apex classes deployed via change sets are automatically executed in production for code coverage validation upon upload.
B.Change sets support full rollback of the entire deployment if any single component fails.
C.Change sets automatically delete components from the target organization if they are removed from the source.
D.Some standard fields and standard objects cannot be included in change sets.
E.Change sets can deploy changes only between organizations that have a deployment connection defined.
AnswersD, E

Standard objects and standard fields have restrictions regarding inclusion in change sets.

Why this answer

Change sets require inbound connection approval, and certain components require manual post-deployment steps or cannot be included.

274
MCQeasy

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

A.@RemoteAction
B.@future
C.@InvocableMethod
D.@AuraEnabled
AnswerC

@InvocableMethod allows Apex code to be called directly from flows.

Why this answer

The @InvocableMethod annotation exposes Apex methods to flows and process builder.

275
Multi-Selecthard

A developer is designing a Batch Apex class that processes millions of records. Which THREE elements are required components of a valid Batch Apex implementation? (Choose three.)

Select 4 answers
A.Implementation of the Database.AllowsCallouts interface automatically.
B.Implementation of the start method returning a Database.QueryLocator or Iterable.
C.Implementation of the finish method for post-processing tasks.
D.Implementation of the execute method to process chunks of records.
E.Implementation of the Database.Batchable interface.
AnswersB, C, D, E

Correct. The start method collects the records to be processed.

Why this answer

Batch Apex classes must implement the Database.Batchable interface and define start, execute, and finish methods.

276
Multi-Selectmedium

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

Select 2 answers
A.SOSL can only query a single object per statement.
B.SOSL can query text across multiple standard and custom objects in a single query.
C.SOSL search results return a list of lists of sObjects.
D.SOSL queries support complex arithmetic calculations and grouping clauses.
E.SOSL queries are executed using the SELECT keyword.
AnswersB, C

SOSL is optimized for cross-object text searches.

Why this answer

SOSL searches across multiple objects and returns lists of sObjects grouped by object type.

277
MCQhard

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

A.Validation rules are evaluated after all before triggers have completed execution.
B.Validation rules execute only after after triggers complete successfully.
C.Validation rules are evaluated concurrently with before triggers.
D.Validation rules are evaluated before any before triggers execute.
AnswerA

Correct. Validation rules run immediately after before triggers finish executing.

Why this answer

Validation rules execute after the 'before' triggers have completed and modified the records, ensuring that the validated state reflects any programmatic field updates.

278
Multi-Selecthard

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

Select 3 answers
A.Global CSS stylesheets automatically penetrate and override LWC shadow DOM styles.
B.Child components can be styled directly from parent CSS files without styling hooks.
C.querySelector calls inside a component only search within that component's template unless using specific host selectors.
D.Styles defined in a component's stylesheet only apply to that component.
E.HTML templates are rendered inside a shadow root for the component.
AnswersC, D, E

DOM queries are encapsulated within the component shadow root.

Why this answer

Shadow DOM encapsulates templates, styles, and queries, preventing external CSS bleeding and restricting queries to the component template.

279
MCQhard

When testing a class that depends on Custom Settings, what is the best practice?

A.Ignore the custom settings in the test.
B.Hardcode the values into the test.
C.Mock the custom settings using a wrapper class.
D.Use the production custom settings.
AnswerC

Best practice for test independence.

Why this answer

Create the custom settings in the test method setup to ensure independence from production data.

280
MCQmedium

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?

A.Use a static variable to cache the query results inside the loop.
B.Collect IDs into a Set and execute a single SOQL query outside the loop.
C.Move the query into a helper method that is called recursively for each record.
D.Wrap the query in a try-catch block to handle governor limit exceptions.
AnswerB

Correct. Collecting IDs into a Set and querying once using the IN clause avoids hitting SOQL governor limits.

Why this answer

To avoid SOQL query limits, queries should be moved outside of loops and leverage collections (lists or sets) to retrieve all required data in a single query.

281
Multi-Selecthard

Which THREE behaviors occur during the execution of a Batch Apex job implemented with standard settings? (Choose three.)

Select 4 answers
A.An AsyncApexJob record is created to track the status, total job items, and errors of the batch execution.
B.All batches in a job execute synchronously on the same thread during the initial call.
C.Batch Apex automatically rolls back the entire 50-million record job if a single record in one chunk fails.
D.The start method returns either a QueryLocator or an Iterable<SObject> to define the dataset.
E.Records are processed in discrete chunks called batches, with a default batch size of 200 records.
AnswersA, B, D, E

Salesforce creates an AsyncApexJob record tracking progress.

Why this answer

Batch Apex runs asynchronously, processes records in chunks (default 200), and creates an AsyncApexJob tracking record.

282
MCQhard

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?

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

Correct because connectedCallback ensures the component is in the DOM for script loading.

Why this answer

Third-party scripts should be loaded in connectedCallback() because the component must be inserted in the DOM before script tags can be appended.

283
MCQmedium

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?

A.Database.executeBatch() enclosed by Test.startTest() and Test.stopTest()
B.Test.runBatch()
C.Test.enqueueJob()
D.System.runAs()
AnswerA

Enclosing Database.executeBatch between startTest and stopTest ensures the batch executes synchronously during the test.

Why this answer

Database.executeBatch inside Test.startTest() and Test.stopTest() executes the batch job in test context.

284
Multi-Selectmedium

Which TWO statements are true regarding the Salesforce security model and Apex execution context? Choose 2 answers.

Select 2 answers
A.Apex code runs in system mode by default, ignoring object and field-level permissions.
B.System mode ignores record-level sharing rules and user permissions entirely.
C.Apex code automatically enforces sharing rules unless declared 'without sharing'.
D.The 'with sharing' keyword enforces record-level sharing rules.
E.Profile permissions always override Apex system mode execution.
AnswersA, D

By default, Apex has access to all objects and fields regardless of user permissions.

Why this answer

Apex runs in system mode by default (ignoring FLS and CRUD), and sharing rules are only enforced if 'with sharing' is declared.

285
Multi-Selectmedium

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

Select 2 answers
A.Apex is better suited for complex algorithmic logic, advanced error handling, and reusable utility classes.
B.Flow Builder allows rapid, declarative updates that are maintainable by administrators without writing code.
C.Flows cannot trigger subflows or call invocable actions.
D.Apex triggers execute significantly slower than record-triggered flows in all scenarios.
E.Flow Builder is required when processing millions of records nightly in asynchronous batches.
AnswersA, B

Apex provides full object-oriented programming capabilities for complex logic and custom libraries.

Why this answer

Flow Builder is declarative and reduces maintenance, while Apex handles complex algorithms, batching, and high-volume triggers.

286
MCQeasy

Which tag is used in Visualforce to iterate over a collection of records and display them in a table?

A.apex:pageBlockTable
B.<apex:repeat>
C.apex:iterator
D.apex:outputPanel
AnswerA

Renders data in a standard Salesforce styled table format.

Why this answer

<apex:pageBlockTable> or <apex:dataTable> are used for tabular iteration.

287
MCQeasy

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

A.lightning-datatable
B.lightning-grid
C.lightning-table
D.apex:pageBlockTable
AnswerA

Standard LWC component for structured data tables.

Why this answer

lightning-datatable is the standard component for tabular data display in LWC.

288
MCQhard

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

A.sf project deploy start
B.sf org create
C.sf project retrieve start
D.sf org login
AnswerA

This command deploys the source code to the target org.

Why this answer

The 'sf project deploy start' command is the current standard for deploying source to an org.

289
Multi-Selectmedium

Which THREE items are included in a debug log?

Select 3 answers
A.System.debug statements.
B.Browser cookies.
C.User password history.
D.SOQL queries.
E.DML operations.
AnswersA, D, E

Custom debug messages are included.

Why this answer

Debug logs contain execution details for DML, SOQL, and custom user debug messages.

290
MCQeasy

Which tool or feature should a developer use to test Lightning Web Components locally on their workstation without deploying to Salesforce every time?

A.The Developer Console preview tab
B.Visual Studio Code Live Server extension pointing to Salesforce org
C.Salesforce CLI force:source:preview command
D.LWC Local Development Server
AnswerD

Correct because the Local Development Server enables local preview.

Why this answer

LWC Local Development Server allows developers to preview components locally.

291
Multi-Selecteasy

Which TWO of the following are valid ways to execute Apex unit tests in Salesforce?

Select 2 answers
A.Developer Console
B.Salesforce CLI
C.Object Manager settings
D.User Management settings
E.Change Sets menu
AnswersA, B

The Developer Console is a primary tool for test execution.

Why this answer

Tests can be run via the Developer Console or the Apex Test Execution page in Setup.

292
Multi-Selecthard

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

Select 3 answers
A.Invoking a future method directly from a scheduled Apex class execute method.
B.Exceeding the maximum synchronous heap size of 6 MB by loading massive attachments into collections.
C.Performing individual DML statements inside a loop for each record in Trigger.new.
D.Accessing Trigger.old in an insert trigger.
E.Executing a SOQL query inside a for loop that iterates over Trigger.new.
AnswersB, C, E

Large data collections exceed the 6 MB synchronous heap limit.

Why this answer

Queries in loops, too many DML statements, and excessive heap size allocation trigger governor limit exceptions.

293
MCQeasy

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

A.5
B.250
C.50
D.100
AnswerD

The Flex Queue holds up to 100 batch jobs in a Holding status.

Why this answer

Salesforce allows up to 100 batch jobs to be placed in the holding queue (Flex Queue) waiting for execution.

294
MCQmedium

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

A.Use a future method for each update
B.Use a for loop to update records one by one
C.Collect records in a list and perform a single DML statement
D.Perform DML inside the loop
AnswerC

Bulkification is essential for efficient Apex.

Why this answer

Bulkify the code to perform operations on collections rather than individual records.

295
MCQmedium

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?

A.renderedCallback()
B.disconnectedCallback()
C.constructor()
D.connectedCallback()
AnswerD

Correct. connectedCallback() runs when the component is inserted into the DOM.

Why this answer

connectedCallback() is invoked when a component is inserted into the DOM, making it the standard hook for initialization logic.

296
MCQmedium

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

A.Governor limits are exceeded.
B.The platform disallows live callouts in test context.
C.The mock server is not found.
D.The callout method is not public.
AnswerB

Prevents external dependencies.

Why this answer

Salesforce blocks all real callouts in tests to prevent side effects.

297
Multi-Selecteasy

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

Select 2 answers
A.Vector
B.Dictionary
C.Hashtable
D.Map
E.List
AnswersD, E

Map is a built-in Apex collection.

Why this answer

List and Map are core collection types in Apex.

298
MCQhard

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?

A.onmyevent={handler}
B.event-myevent={handler}
C.on-myevent={handler}
D.listener={handler}
AnswerA

Standard LWC syntax for listening to custom events (lowercased event name).

Why this answer

Child events are listened to using on<eventname> attribute syntax in the parent template.

299
MCQhard

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?

A.Prefix the parameter passed to the wire adapter with a dollar sign ($) in the JavaScript file.
B.Wrap the property in a standard JavaScript Proxy object.
C.Decorate the parameter with @track and call this.updateWire() explicitly.
D.Invoke the refreshApex() method inside the component constructor.
AnswerA

Correct because the $ prefix denotes a reactive property that triggers reprovisioning when changed.

Why this answer

Wire adapters automatically provision data when reactive parameters (prefixed with $) change.

300
MCQeasy

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

A.Set
B.Queue
C.Map
D.List
AnswerC

Maps store associations between keys and values.

Why this answer

A Map stores key-value pairs where each unique key maps to a single value.

Page 3

Page 4 of 7

Page 5

All pages