Courseiva

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

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

Page 5

Page 6 of 7

Page 7
376
MCQhard

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

A.The flow fails
B.The trigger is queued for later
C.The trigger executes immediately in the same transaction
D.The trigger is ignored
AnswerC

Salesforce re-enters the order of execution.

Why this answer

This is part of the re-entrant execution, where Salesforce processes the trigger as part of the flow's transaction.

377
MCQhard

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?

A.Event emitter pattern
B.Promise chaining
C.Async/await callback pattern
D.Wired property / result object pattern
AnswerD

Wire results provide data and error properties.

Why this answer

Wire adapters return a wrapper object containing data and error properties.

378
MCQeasy

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?

A.Trigger.isExecuting
B.Trigger.isBefore
C.Trigger.isInsert
D.Trigger.isUpdate
AnswerD

Trigger.isUpdate is the correct boolean context variable for update operations.

Why this answer

Trigger.isUpdate returns true if the trigger was fired due to an update operation.

379
MCQeasy

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?

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

Correct. lightning__RecordPage makes the component available for placement on record pages in Lightning App Builder.

Why this answer

To expose a component on a record page, the targets list must include lightning__RecordPage.

380
Multi-Selecthard

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

Select 3 answers
A.Perform time-consuming operations or bulk data generation once to avoid hitting governor limits in separate test methods.
B.Hardcode specific record IDs assigned during @TestSetup into downstream test assertions.
C.Create parent records (such as Accounts) that can be queried and associated with child records in individual test methods.
D.Call external REST callouts inside the @TestSetup method to fetch live seed data.
E.Modify records created in @TestSetup within test methods without worrying about state pollution, because Salesforce automatically rolls back modifications made by each test method.
AnswersA, C, E

@TestSetup runs once per class, preserving governor limits for test methods.

Why this answer

Test setup methods create shared records efficiently and roll back per method.

381
Multi-Selecteasy

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

Select 3 answers
A.Boolean
B.WorkflowRule
C.Integer
D.LightningComponent
E.String
AnswersA, C, E

Boolean is a primitive data type in Apex.

Why this answer

Apex supports standard primitive types including Boolean, Integer, and String.

382
MCQeasy

Which log level displays the most information?

A.WARN.
B.DEBUG.
C.INFO.
D.FINEST.
AnswerD

Most detailed level.

Why this answer

FINEST is the most granular log level available.

383
MCQhard

A developer is writing a Lightning Web Component and needs to conditionally render a block of HTML markup based on a boolean property named 'isVisible'. What is the correct syntax in the HTML template?

A.<apex:outputPanel rendered="{!isVisible}">
B.<template condition="{isVisible}">
C.<template if:true={isVisible}>
D.<div ng-if="isVisible">
AnswerC

Correct because template with if:true is the standard conditional rendering directive.

Why this answer

Conditional rendering in LWC uses the l:if directive or template conditional directives. Wait, the correct directive is lwc:if.

384
Multi-Selecthard

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

Select 3 answers
A.Modify the Org's license type.
B.Query data from an org.
C.Update user passwords.
D.Create a scratch org.
E.Deploy metadata to an org.
AnswersB, D, E

Core CLI feature.

Why this answer

The CLI supports org management, code deployment, and data management.

385
MCQeasy

Which tool is best suited for running all tests in an org and viewing the code coverage percentages?

A.Salesforce Setup Menu
B.Developer Console
C.Change Sets
D.Workbench
AnswerB

The Developer Console is the primary tool for testing and coverage analysis.

Why this answer

The Developer Console provides a built-in interface to run tests and view code coverage immediately.

386
MCQeasy

Which of these is NOT a valid testing best practice?

A.Testing for bulk records.
B.Using System.assertEquals.
C.Using @isTest.
D.Hard-coding record IDs.
AnswerD

This is a bad practice.

Why this answer

Hard-coding data is a bad practice.

387
MCQhard

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

A.Use Test.stopTest()
B.Query the AsyncApexJob object
C.Use System.runAs()
D.Use Thread.sleep()
AnswerA

Test.stopTest() executes all asynchronous operations queued during the test.

Why this answer

Test.stopTest() forces any asynchronous processes, such as @future or Schedulables, to execute before the code execution continues.

388
MCQmedium

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?

A.@IsTest(SeeAllData=true)
B.@TestVisible
C.@RemoteAction
D.@TestSetup
AnswerD

@TestSetup methods are executed once per test class and roll back data between test method executions.

Why this answer

The @TestSetup annotation allows developers to create test records once and make them available for all test methods in the class.

389
MCQmedium

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

A.It allows access to the full production database automatically.
B.It increases the number of available governor limits.
C.It allows development without affecting production data.
D.It automatically deploys code to production.
AnswerC

Provides a safe environment for testing.

Why this answer

Sandboxes provide an isolated environment to prevent impact on production data or processes.

390
Multi-Selecthard

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.

Select 3 answers
A.Call Limits.getQueries() at the start of every trigger to abort if limits are near.
B.Utilize Custom Settings or Custom Metadata to provide a global toggle to turn off triggers dynamically.
C.Wrap all DML statements in a try-catch block that catches recursion exceptions.
D.Compare old and new field values using Trigger.oldMap and Trigger.newMap to check if relevant fields actually changed.
E.Use a static boolean variable in a helper class set to false after the first execution.
AnswersB, D, E

Dynamic kill-switches allow administrators or developers to disable faulty or recursive triggers instantly.

Why this answer

Trigger recursion can be prevented using static boolean flags in a helper class, utilizing trigger context maps to check if specific fields actually changed, or leveraging custom metadata/settings to disable triggers dynamically.

391
MCQhard

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

A.Running more than 500 batch jobs simultaneously.
B.Exceeding the daily asynchronous Apex limit of 250,000.
C.Making more than 100 callouts in a future method.
D.Exceeding the maximum number of 50 queued jobs in a single transaction.
AnswerD

Adding more than 50 queueable jobs in a single transaction throws this exception.

Why this answer

Exceeding the limit of 50 queued jobs added to the flex queue in a single transaction triggers this AsyncException.

392
MCQhard

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?

A.Wrap the test assertion code between Test.startTest() and Test.stopTest().
B.Mark the test method with @isTest(SeeAllData=true).
C.Wrap the trigger logic in a Database.setSavepoint() block.
D.Use Limits.getLimitQueries() inside the test method.
AnswerA

Test.startTest and Test.stopTest reset governor limits so that heavy test setup data generation does not count against the tested code limits.

Why this answer

Test.startTest() resets all governor limits for the code executed immediately following it, up until Test.stopTest().

393
MCQhard

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?

A.errorCallback
B.catchCallback
C.disconnectedCallback
D.faultCallback
AnswerA

Catches errors from child components.

Why this answer

errorCallback() is invoked when a descendant component throws an error in any of its lifecycle hooks or event handlers.

394
MCQeasy

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?

A.100%
B.50%
C.75%
D.85%
AnswerC

Salesforce requires at least 75% of all Apex code in the org to be covered by unit tests.

Why this answer

Salesforce requires a minimum of 75% overall Apex code coverage for deployment to a production organization.

395
MCQeasy

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

A.60,000 milliseconds
B.5,000 milliseconds
C.120,000 milliseconds
D.10,000 milliseconds
AnswerD

10,000 ms is the synchronous CPU time limit.

Why this answer

The synchronous CPU time limit is 10,000 milliseconds (10 seconds).

396
Multi-Selecthard

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

Select 3 answers
A.Slice the master dataset array based on current offset and limit calculations.
B.Use standard Visualforce standardSetController inside the LWC JavaScript.
C.Disable navigation buttons (Next/Previous) when boundary conditions are reached.
D.Maintain reactive properties for the current page number and page size.
E.Directly mutate the server database on every page click.
AnswersA, C, D

Slicing arrays displays the correct subset for the page.

Why this answer

Custom pagination requires managing current page state, calculating total pages, and updating displayed subsets of data reactively.

397
MCQmedium

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?

A.sf org login web
B.sf org create sandbox
C.sf project retrieve start
D.sf org create scratch
AnswerD

sf org create scratch creates a source-tracked scratch org using a project-scratch-def.json file.

Why this answer

sf org create scratch creates a scratch org based on a definition file.

398
MCQmedium

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?

A.void execute(Database.BatchableContext BC, List<SObject> scope)
B.void finish(Database.BatchableContext BC)
C.Database.QueryLocator start(Database.BatchableContext BC)
D.Database.BatchableContext start(Database.BatchableContext BC)
AnswerC

QueryLocator is the standard and most efficient way to fetch records for batch processing.

Why this answer

The start method of a Database.Batchable class returns either a Database.QueryLocator or an Iterable that defines the records to be processed.

399
Multi-Selectmedium

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

Select 2 answers
A.Call ApexPages.addMessage() to display the error on screen.
B.Extract the error message from the error object structure (e.g., error.body.message).
C.Rethrow the error as an unhandled Java exception.
D.Catch the error using a .catch() block or try/catch with async/await.
E.Use standard window.alert() for all error messaging.
AnswersB, D

Standard Salesforce error body structure format.

Why this answer

Errors from imperative Apex should be caught in a .catch() block and processed or displayed using a toast notification or error banner.

400
MCQhard

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

A.Queueable
B.Batchable
C.Schedulable
D.Future
AnswerA

Queueable Apex supports chaining through System.enqueueJob.

Why this answer

Queueable Apex allows for chaining jobs by calling System.enqueueJob within the execute method.

401
MCQmedium

A developer runs unit tests in the Developer Console and notices that one test method fails when run as part of the entire test class, but passes successfully when run in isolation. What is the most likely cause of this issue?

A.The Developer Console caches old test results automatically.
B.The test class lacks the @isTest annotation.
C.Governor limits are permanently exhausted for the entire session.
D.Test data pollution caused by another test method modifying shared records without resetting state.
AnswerD

Shared state and lack of data isolation between methods in the same class can cause dependent test failures.

Why this answer

Test pollution occurs when test data modified or created by one test method is not properly cleaned up, affecting subsequent test methods.

402
MCQhard

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

A.It creates different code execution paths between test and production
B.It causes the test to fail
C.It causes excessive governor limit usage
D.It is not supported in production
AnswerA

It is better to avoid conditional logic that changes runtime behavior based on test context.

Why this answer

While sometimes necessary, relying on it can lead to code paths that are not tested in production exactly as they execute in tests.

403
MCQmedium

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?

A.Pass the parameter as an object with property names matching the Apex method parameters: getAccount({ accountId: recordId })
B.Pass the parameter as a positional string argument: getAccount({recordId})
C.Bind the parameter using the @api decorator inside the JavaScript function body.
D.Assign the parameter to the window.apexParams object prior to invocation.
AnswerA

Correct because imperative Apex requires an object parameter mapping.

Why this answer

Imperative Apex methods accept an object whose properties match the parameter names expected by the Apex method signature.

404
MCQhard

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?

A.Use System.runAs() to execute the test under a user with API Enabled permissions
B.Use Test.setMock(HttpCalloutMock.class, new MockHttpResponseGenerator())
C.Wrap the trigger logic inside a Test.startTest() and Test.stopTest() block without mocks
D.Set the remote site setting dynamically inside the test method before the trigger fires
AnswerB

Test.setMock informs the runtime to return a simulated response instead of making a real callout.

Why this answer

Apex runtime throws an exception if a callout is attempted in a test without being mocked. The developer must implement the HttpCalloutMock interface and use Test.setMock().

405
MCQeasy

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

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

Correct. Trigger.oldMap is a map of IDs to the old version of the SObject records.

Why this answer

Trigger.oldMap provides a map of IDs to the old versions of the SObject records for update and delete triggers.

406
MCQmedium

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

A.It clears all variables created in the test.
B.It forces all queued asynchronous jobs to complete.
C.It resets the debug logs.
D.It stops all further execution of the test class.
AnswerB

Main function of stopTest.

Why this answer

It executes all asynchronous code queued during the test.

407
Multi-Selectmedium

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

Select 2 answers
A.It speeds up test execution.
B.It is required for testing standard objects.
C.It ignores all governor limits.
D.It makes tests results dependent on the org's existing data.
E.It exposes all existing data in the org to the test method.
AnswersD, E

True, this is the main risk.

Why this answer

It grants access to all org data and can lead to unexpected test results.

408
MCQeasy

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?

A.Tests tab
B.Query Editor tab
C.DOM Inspector tab
D.Logs tab
AnswerA

The Tests tab displays test suites, test runs, and code coverage metrics.

Why this answer

The Tests tab in the Developer Console displays test execution status, test results, and code coverage percentages by class.

409
MCQmedium

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?

A.@AuraEnabled
B.@InvocableMethod
C.@RemoteAction
D.@WebService
AnswerA

@AuraEnabled exposes Apex methods and properties to Lightning components (LWC and Aura).

Why this answer

@AuraEnabled enables methods to be called from Lightning components and can also cache data.

410
MCQeasy

Which utility class is used to assert that code behaves as expected in Apex tests?

A.Test.assert().
B.Test.verify().
C.Assert.verify().
D.System.assertEquals().
AnswerD

Correct method for assertions.

Why this answer

The System.assertEquals method is the standard way to verify expected outcomes.

411
MCQmedium

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

A.Change the class to @isTest.
B.Use the @TestVisible annotation.
C.There is no way to inspect private variables.
D.Make the variable public.
AnswerB

Safely exposes private members to tests.

Why this answer

@TestVisible allows test classes to access private variables without making them public.

412
MCQhard

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?

A.Any
B.Variant
C.Object
D.Dynamic
AnswerC

Object is the universal superclass in Apex capable of holding any data type.

Why this answer

The Object data type is the base data type in Apex and can hold any value, including primitives, sObjects, and collections.

413
MCQeasy

Which tag is used in Visualforce to embed JavaScript code directly inside the page?

A.<apex:script>
B.<apex:js>
C.<apex:code>
D.<apex:javascript>
AnswerA

Visualforce tag for including scripts.

Why this answer

<apex:includeScript> or <apex:outputPanel> can include scripts, but <apex:includeScript> links external JS files. For inline script, standard HTML <script> tag is used within Visualforce.

414
MCQeasy

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

A.When processing millions of historical records nightly.
B.When making external web service callouts synchronously.
C.When actions need to execute 30 days after a contract is signed.
D.When actions need to occur instantly upon record creation.
AnswerD

Immediate record-triggered flows run synchronously right when the record is saved.

Why this answer

Record-triggered flows execute immediately upon record creation or update, whereas scheduled paths run at a specific time offset.

415
MCQhard

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?

A.reloadRecord
B.updateRecordCache
C.getRecordRefresh
D.refreshApex
AnswerD

Refreshes data obtained from an Apex wire adapter.

Why this answer

refreshApex is used to imperatively refresh data provisioned by an Apex wire adapter.

416
MCQhard

A developer implements a Batch Apex class that updates millions of records. During the execution of the execute method, a transient database error occurs on a single record. What happens to the batch job by default if Database.executeBatch is called without additional parameters?

A.The failed record is placed in a retry queue for asynchronous reprocessing.
B.The entire batch job fails immediately, and no further chunks are processed.
C.Only the failed record is rolled back, and the batch continues processing the remaining records.
D.The entire database transaction is rolled back, but the batch continues to the next execute method.
AnswerB

Correct. Uncaught exceptions in a batch execution cause the transaction to fail and the entire batch job to be marked as Failed.

Why this answer

By default, if an unhandled exception occurs in a batch chunk, the entire batch job fails and the error is logged, unless Database.insert is used with allOrNone set or exception handling is implemented.

417
Multi-Selectmedium

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

Select 2 answers
A.From the User record.
B.By editing an Apex class.
C.Apex Test Execution page in Setup.
D.From a Workflow Rule.
E.Developer Console.
AnswersC, E

Standard UI for running tests.

Why this answer

Tests can be run from the Developer Console and from the Apex Test Execution page.

418
MCQhard

What is the primary constraint on using @testSetup?

A.It creates data that is isolated from the test methods.
B.It must be a void method.
C.It cannot interact with the database.
D.It can only be used once per project.
AnswerB

Correct, @testSetup must return void.

Why this answer

It cannot be used with @isTest(SeeAllData=true) in a way that allows access to existing data for setup.

419
MCQmedium

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?

A.ERROR
B.FINEST
C.INFO
D.DEBUG
AnswerB

FINEST captures the most detailed information including database performance.

Why this answer

The FINEST level for the Database category captures the most detailed information, including resource usage and DML/SOQL performance metrics.

420
Multi-Selectmedium

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)

Select 2 answers
A.lightning__CustomField
B.lightning__HomePage
C.lightning__ApprovalProcess
D.lightning__ApexClass
E.lightning__RecordPage
AnswersB, E

Correct because lightning__HomePage targets home pages.

Why this answer

lightning__RecordPage and lightning__HomePage are valid standard targets.

421
MCQhard

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

A.The test execution proceeds, but without data.
B.The platform ignores the @testSetup failure.
C.The entire test class fails to execute.
D.Only the first test method fails.
AnswerC

Setup is a prerequisite for the class.

Why this answer

The test class setup fails, and all test methods in the class will fail to execute.

422
MCQeasy

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?

A.Queueable
B.List
C.Map
D.Set
AnswerD

Sets contain unique elements and offer fast lookups.

Why this answer

A Set is a collection of unique elements and provides efficient lookup using methods like contains(), making it ideal for checking existence.

423
MCQmedium

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

A.When the automation requires complex external web service callouts.
B.When handling recursive trigger execution across multiple custom objects.
C.When performing complex DML operations on up to five related child objects.
D.When updating fields on the same record being saved for better performance and maintainability.
AnswerD

Correct. Before-save flows run significantly faster than Apex triggers and provide declarative maintainability.

Why this answer

Before-save record-triggered flows execute faster than Apex before-triggers and are fully declarative, making them the preferred choice for same-record field updates.

424
MCQeasy

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

A.Before Undelete and After Undelete
B.Before Insert and After Insert
C.Before Update
D.Before Delete and After Delete
AnswerA

Salesforce provides before undelete and after undelete trigger events for restored records.

Why this answer

Undelete triggers handle records restored from the recycle bin.

425
MCQhard

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

A.System.cancelJob()
B.apexJob.terminate()
C.Database.stopBatch()
D.System.abortJob()
AnswerD

System.abortJob takes the job ID of a scheduled or flex-queue job to stop it.

Why this answer

System.abortJob(jobId) cancels a scheduled or flex-queued asynchronous job.

426
Multi-Selectmedium

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

Select 2 answers
A.Chain multiple queueable jobs simultaneously within a single synchronous transaction without limits.
B.Use future methods inside queueable execute methods instead of chaining queueable jobs.
C.Ensure that chained jobs handle governor limits and bulk data efficiently in each execution context.
D.Implement exit criteria or conditional checks to prevent infinite job chaining loops.
E.Hardcode all job IDs to ensure static binding between jobs.
AnswersC, D

Each chained job runs in a new transaction, requiring proper bulkification and limit management.

Why this answer

Chaining queueable jobs should be conditional to avoid infinite loops and should monitor flex queue limits.

427
MCQmedium

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?

A.repeat:for
B.for:each
C.apex:repeat
D.aura:iteration
AnswerB

Iterates over arrays in LWC templates.

Why this answer

for:each is the standard directive for looping in LWC templates.

428
MCQmedium

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?

A.Unmanaged change sets require manual XML editing prior to upload.
B.Change sets do not support the deployment of custom fields under any circumstances.
C.Field-level security settings on profiles are sometimes omitted or overridden if the target profile already exists and has conflicting security configurations.
D.Profiles cannot be included in outbound change sets.
AnswerC

Existing profiles in target orgs can cause permission merge conflicts during change set deployments.

Why this answer

Profiles and permission sets in change sets require careful component selection, and field-level security is often best handled via permission sets or post-deployment steps.

429
Multi-Selecthard

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

Select 3 answers
A.Use synchronous imperative Apex calls inside template iterators.
B.Provide a unique, stable 'key' attribute (such as record Id) on each iterated element in for:each loops.
C.Implement pagination or virtual scrolling / lazy loading for large datasets.
D.Avoid heavy computations inside template getter properties called during renders.
E.Render all 10,000 records at once in a single flat DOM tree without pagination.
AnswersB, C, D

Helps the diff algorithm track elements efficiently.

Why this answer

Performance for large lists can be optimized by using pagination or infinite scrolling, ensuring unique stable keys in for:each loops, and avoiding complex nested getters.

430
MCQmedium

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?

A.Use an immediate DML statement update Trigger.new; inside the trigger.
B.Instantiate a separate list of the same records and call database.insert().
C.Utilize an after insert trigger to perform an update DML operation.
D.Assign values directly to the fields on the records in Trigger.new.
AnswerD

Before trigger context allows direct modification of record fields in Trigger.new without DML statements.

Why this answer

In a before insert trigger, records are already in memory and have not yet been saved to the database. Developers can modify fields directly on the Trigger.new records without calling an explicit DML operation.

431
MCQhard

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?

A.Roll-up summary fields are calculated before before-triggers fire.
B.Roll-up summaries are deferred until a nightly batch runs.
C.Roll-up summary fields on the parent record are calculated after child DML and can trigger parent-level rules and triggers.
D.Roll-up summary calculations never trigger parent triggers.
AnswerC

Parent roll-ups update after child changes, subsequently firing parent rules and triggers.

Why this answer

Roll-up summary fields are recalculated by Salesforce after DML operations on child records and before the transaction completes, triggering parent rules.

432
MCQhard

A developer is implementing a custom logging framework in Apex. Due to high transaction volumes, multiple asynchronous log entries need to be queued without hitting the maximum number of queueable jobs allowed in a single transaction. What is the execution limit for chained Queueable jobs?

A.Only one child job can be chained from a given Queueable job in a non-test context.
B.Queueable jobs cannot be chained under any circumstances.
C.Up to 50 child jobs can be chained in a single transaction.
D.There is no limit to the number of chained queueable jobs.
AnswerA

Salesforce limits Queueable chaining such that you can only enqueue one subsequent job from executing context.

Why this answer

Queueable Apex supports chaining jobs, but synchronous transactions have strict limits on how many times a job can be chained consecutively.

433
MCQhard

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?

A.Reassign the property reference (e.g., this.myObj = {...this.myObj}).
B.Use @track on every inner property.
C.Call component.forceUpdate().
D.Mutate the nested property directly; LWC automatically deep-tracks all mutations.
AnswerA

Assignment triggers reactivity by changing reference.

Why this answer

Assigning a new object or array reference (mutation via replacement) triggers reactivity in LWC tracked properties.

434
Multi-Selecthard

Which TWO actions are valid best practices when writing robust Batch Apex classes to adhere to governor limits and maintain data integrity? Choose 2 options.

Select 2 answers
A.Call external web service callouts synchronously for every single record inside the execute method without batching.
B.Query all related child records in the start method without considering heap size limits.
C.Hardcode record type IDs inside the execute method to save SOQL queries.
D.Implement Database.Stateful only when it is necessary to maintain state across transaction chunks.
E.Use Database.getQueryLocator in the start method when processing millions of records to efficiently manage query limits.
AnswersD, E

Database.Stateful preserves member variable values across transactions, but should only be used when necessary as it impacts performance and memory.

Why this answer

Batch Apex classes should utilize Database.getQueryLocator for large datasets to avoid heap size limits, and stateful tracking should be minimized unless specifically required to track aggregate metrics across batches.

435
MCQhard

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?

A.System.getCPU()
B.AsyncApexJob.getCpuTime()
C.BatchContext.getCpuTime()
D.Limits.getCpuTime()
AnswerD

Limits.getCpuTime() returns the CPU time consumed so far in the current transaction.

Why this answer

Limits.getLimitCpuTime() and Limits.getCpuTime() allow developers to monitor resource usage dynamically.

436
Multi-Selectmedium

Which TWO trigger context variables are available in BEFORE INSERT triggers? Choose 2 options.

Select 2 answers
A.Trigger.oldMap
B.Trigger.old
C.Trigger.operationType
D.Trigger.new
E.Trigger.newMap
AnswersD, E

Trigger.new holds the new records being inserted.

Why this answer

Trigger.new and Trigger.newMap are available in Before Insert triggers.

437
MCQmedium

A developer needs to run an Apex class in system mode, ignoring user-level object and field-level permissions, but enforcing organization-wide sharing rules. How should the class be declared?

A.public system mode class MyClass
B.public without sharing class MyClass
C.public with sharing class MyClass
D.public inherited sharing class MyClass
AnswerC

'with sharing' enforces record-level sharing rules while Apex code otherwise runs in system mode (ignoring FLS/CRUD).

Why this answer

Declaring a class with 'with sharing' enforces sharing rules while inheriting the execution context's sharing mode, but to explicitly ignore CRUD/FLS while respecting sharing, 'with sharing' is standard, while 'without sharing' ignores sharing entirely. To enforce sharing rules while maintaining system mode for FLS, developers use specific methods or classes; however, standard class-level keywords are 'with sharing', 'without sharing', or omitting sharing keywords to inherit. Wait, system mode ignores FLS/CRUD automatically unless specified, but sharing rules are controlled by the sharing keyword.

Using 'with sharing' enforces sharing rules.

438
MCQmedium

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?

A.Schema.sObjectType.Account.fields.AnnualRevenue.getDescribe().isAccessible()
B.User.hasReadAccess('Account', 'AnnualRevenue')
C.Account.AnnualRevenue.getDescribe().isAccessible()
D.System.checkFieldAccess(Account.class, 'AnnualRevenue', 'Read')
AnswerA

This is the correct syntax for checking field-level security readability in Apex.

Why this answer

Schema.sObjectType.Account.fields.AnnualRevenue.getDescribe().isAccessible() checks field-level security for the current user in Apex.

439
MCQhard

An enterprise application requires dynamic execution of a SOQL query where the object type and fields to query are determined at runtime based on user input. Which feature should the developer use to prevent SOQL injection vulnerabilities?

A.System.assert()
B.JSON.serialize()
C.Database.setSavepoint()
D.String.escapeSingleQuotes()
AnswerD

String.escapeSingleQuotes adds escape characters to all single quotation marks in a string, neutralizing SOQL injection attempts.

Why this answer

Dynamic SOQL queries must use binding variables or sanitize input using String.escapeSingleQuotes() to prevent malicious SOQL injection.

440
MCQmedium

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

A.When complex procedural logic is needed
B.When updating fields
C.When using standard objects
D.When sending emails
AnswerA

Apex provides a more robust environment for complex procedural logic.

Why this answer

Apex should be used when complex logic is required that cannot be represented in the Flow canvas, such as complex loops or high-performance algorithms.

441
Multi-Selecthard

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

Select 3 answers
A.Using Security.stripInaccessible() before upserting data.
B.Adding WITH SECURITY_ENFORCED to SOQL queries.
C.Performing explicit Schema describe checks (e.g., isAccessible()).
D.Declaring every class with 'without sharing'.
E.Relying solely on Lightning Web Component HTML rendering tags.
AnswersA, B, C

Strips unauthorized fields gracefully.

Why this answer

Security.stripInaccessible, WITH SECURITY_ENFORCED clause, and explicit Schema describe checks are valid methods.

442
MCQhard

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?

A.dragstart
B.dropstart
C.dragover and preventDefault()
D.mousedown
AnswerC

Preventing default on dragover permits dropping.

Why this answer

Preventing default on dragover is required to allow a drop event to fire on an element.

443
Multi-Selectmedium

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

Select 2 answers
A.Trigger.old is available in insert triggers
B.Trigger.old is available in update triggers
C.Trigger.newMap is available in before insert
D.Trigger.new is available in delete triggers
E.Trigger.new is available in update triggers
AnswersB, E

It holds the old version of records.

Why this answer

Trigger.new is always present on insert/update; Trigger.old is always present on update/delete.

444
MCQeasy

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

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

Trigger.new holds the new record versions.

Why this answer

Trigger.new contains all the new versions of the sObject records for insert and update triggers.

445
MCQhard

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

A.It violates Apex syntax rules.
B.It limits the test to only one record.
C.It triggers governor limits.
D.IDs change between orgs, causing test failures.
AnswerD

Code should query for data or create it dynamically.

Why this answer

IDs are not consistent across environments, which causes tests to fail in deployment.

446
MCQhard

A developer is implementing a Visualforce page that displays a list of accounts and needs to ensure that it adheres to Salesforce security best practices by preventing cross-site scripting (XSS) attacks. Which tag or attribute combination should be used to securely output user-supplied data?

A.<apex:includeScript value="{!userSuppliedScript}" />
B.<apex:outputField value="{!account.Name}"> with escape="false"
C.<apex:outputText value="{!userSuppliedInput}" escape="true" />
D.{!$User.UIThemeDisplayed} without any wrappers
AnswerC

Correct. Setting escape="true" on apex:outputText ensures that user input is properly encoded to prevent XSS.

Why this answer

The apex:outputText tag automatically escapes HTML by default, preventing XSS. Alternatively, setting escape=true on bindings ensures safety.

447
MCQeasy

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

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

Trigger.newMap provides a keyed lookup of records by ID for the new state.

Why this answer

Trigger.newMap contains the map of IDs to the new versions of the sObject records, available only in update, undelete, and after insert contexts.

448
MCQhard

An Apex trigger needs to execute logic only when a specific custom field (Discount_Percent__c) on an Opportunity changes its value. Which comparison should the developer use?

A.Trigger.isChanged('Discount_Percent__c')
B.Trigger.new[i].Discount_Percent__c != Trigger.old[i].Discount_Percent__c
C.Trigger.new[i].Discount_Percent__c != Trigger.oldMap.get(Trigger.new[i].Id).Discount_Percent__c
D.Trigger.new[i].Is_Modified__c == true
AnswerC

Using Trigger.oldMap with record IDs is the robust way to compare old and new field values.

Why this answer

Comparing Trigger.new[i].Discount_Percent__c with Trigger.oldMap.get(Trigger.new[i].Id).Discount_Percent__c ensures code runs only when the field value is modified during an update.

449
MCQeasy

Which annotation is required for a method to be recognized by the Apex test runner?

A.@testMethod.
B.@TestVisible.
C.@future.
D.@isTest.
AnswerD

@isTest defines the class or method as a test.

Why this answer

@isTest is the required annotation for test classes and methods.

450
MCQmedium

A developer needs to schedule an Apex class to run weekly. Which syntax correctly schedules the job using System.schedule?

A.System.scheduleBatch(new MySchedulableClass(), 'Weekly Job', 200);
B.System.enqueueJob(new MySchedulableClass(), '0 0 0 ? * MON *');
C.System.schedule(new MySchedulableClass(), '0 0 0 ? * MON *');
D.System.schedule('Weekly Job', '0 0 0 ? * MON *', new MySchedulableClass());
AnswerD

Correct. This provides the job name, valid CRON string, and class instance.

Why this answer

System.schedule requires a job name, a valid CRON expression, and an instance of the Schedulable class.

Page 5

Page 6 of 7

Page 7

All pages