Summer Special 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: bestdeal

Free Salesforce PDI Practice Exam with Questions & Answers | Set: 2

Questions 11

A team of many developers work in their own individual orgs that have the same configuration as the production org.

Which type of org is best suited for this scenario?

Options:
A.

Developer Sandbox

B.

Full Sandbox

C.

Developer Edition

D.

Partner Developer Edition

Salesforce PDI Premium Access
Questions 12

A developer wants to improve runtime performance of Apex calls by caching results on the client.

What is the most efficient way to implement this and follow best practices?

Options:
A.

Decorate the server-side method with @AuraEnabled(cacheable=true).

B.

Call the setStorable() method on the action in the JavaScript client-side code.

C.

Decorate the server-side method with @AuraEnabled(storable=true).

D.

Set a cookie in the browser for use upon return to the page.

Questions 13

A developer has an integer variable called maxAttempts. The developer needs to ensure that once maxAttempts is initialized, it preserves its value for the length of the Apex transaction; while being able to share the variable's state between trigger executions.

How should the developer declare maxAttempts to meet these requirements?

Options:
A.

Declare maxattempts as a constant using the static and final keywords.

B.

Declare maxattempts as a member variable on the trigger definition.

C.

Declare maxattempts as a variable on a helper class.

D.

Declare maxAttempts as a private static variable on a helper class.

Questions 14

A developer creates a batch Apex job to update a large number of records, and receives reports of the job timing out and not completing.

What is the first step towards troubleshooting the issue?

Options:
A.

Check the asynchronous job monitoring page to view the job status and logs.

B.

Check the debug logs for the batch job.

C.

Disable the batch job and recreate it with a smaller number of records.

D.

Decrease the batch size to reduce the load on the system.

Questions 15

What is the value of the Trigger.old context variable in a before insert trigger?

Options:
A.

An empty list of sObjects

B.

Undefined

C.

null

D.

A list of newly created sObjects without IDs

Questions 16

Assuming that name is a String obtained by a Visualforce page, which two SOQL queries performed are safe from SOQL injection? (Choose two.)

Options:
A.

apex

Copy

String query = '%' + name + '%';

List results = [SELECT Id FROM Account WHERE Name LIKE :query];

B.

apex

Copy

String query = 'SELECT Id FROM Account WHERE Name LIKE \'%' + name.noQuotes() + '%\'';

List results = Database.query(query);

C.

apex

Copy

String query = 'SELECT Id FROM Account WHERE Name LIKE \'%' + String.escapeSingleQuotes(name) + '%\'';

List results = Database.query(query);

D.

apex

Copy

String query = 'SELECT Id FROM Account WHERE Name LIKE \'%' + name + '%\'';

List results = Database.query(query);

Questions 17

Given the following Apex statement:

Account myAccount = [SELECT Id, Name FROM Account);

What occurs when more than one Account is returned by the SOQL query?

Options:
A.

The variable, myaccount, is automatically cast to the List data type.

B.

An unhandled exception is thrown and the code terminates.

C.

The query fails and an error is written to the debug log.

D.

The first Account returned is assigned to myAccount.

Questions 18

A developer is creating a Lightning web component to show a list of sales records.

The Sales Representative user should be able to see the commission field on each record. The Sales Assistant user should be able to see all fields on the record except the commission field.

How should this be enforced so that the component works for both users without showing any errors?

Options:
A.

Use WITH SECURITY_ENFORCED In the SOQL that fetches the data for the component,

B.

Use Security.stripInaccessible Le to remove fields inaccessible to the current user.

C.

Use Lightning Locker Service to enforce sharing rules and field-level security.

D.

Use Lightning Data Service to get the collection of sales records.

Questions 19

A developer created these three Rollup Summary fields in the custom object, Project__c:

The developer is asked to create a new field that shows the ratio between rejected and approved timesheets for a given project.

Which should the developer use to implement the business requirement in order to minimize maintenance overhead?

Options:
A.

Formula field

B.

Record-triggered flow

C.

Roll-up summary field

D.

Apex trigger

Questions 20

How is a controller and extension specified for a custom object named "Notice" on a Visualforce page?

Options:
A.

apex:page standardController="Notice_c" extensions="myControllerExtension"”

B.

apex:page controllers="Notice_c, myContcollerExtension"

C.

apex:pege=Notice extends="myControllerExtension”

D.

apex:page controller="Notice_c" extensions="myControllerExtension"

Exam Code: PDI
Certification Provider: Salesforce
Exam Name: Salesforce Certified Platform Developer 1 (SP25)
Last Update: Jul 10, 2025
Questions: 204