PDI Salesforce Exam Practice Questions
PDI Salesforce Exam Practice Questions
What's Inside:
Important Note:
For full access to the complete question bank and topic-wise explanations, visit:
CertQuestionsBank.com
FB page: https://www.facebook.com/certquestionsbank
Share some PDI exam online questions below.
1.A business has a proprietary Order Management System (OMS) that creates orders from their
website and fulfills the orders. When the order is created in the OMS, an integration also creates an
order record in Salesforce and relates it to the contact as identified by the email on the order. As the
order goes through different stages in the OMS, the integration also updates It in Salesforce. It is
noticed that each update from the OMS creates a new order record in Salesforce.
Which two actions will prevent the duplicate order records from being created in Salesforce? Choose
2 answers
A. Ensure that the order number in the OMS is unique.
B. Use the order number from the OMS as an external ID.
C. Use the email on the contact record as an external ID.
D. Write a before trigger on the order object to delete any duplicates.
Answer: A, D
2.A developer is tasked to perform a security review of the ContactSearch Apex class that exists in
the system. Whithin the class, the developer identifies the following method as a security threat:
List<Contact> performSearch(String lastName){ return Database.query('Select Id, FirstName,
LastName FROM Contact WHERE LastName Like %'+lastName+'%); }
What are two ways the developer can update the method to prevent a SOQL injection attack?
Choose 2 answers
A. Use variable binding and replace the dynamic query with a static SOQL.
B. Use the escapeSingleQuote method to sanitize the parameter before its use.
C. Use a regular expression on the parameter to remove special characters.
D. Use the @Readonly annotation and the with sharing keyword on the class.
Answer: C, D
3.When importing and exporting data into Salesforce, which two statements are true? Choose 2
answers
A. Bulk API can be used to import large data volumes in development environments without
bypassing the storage limits.
B. Bulk API can be used to bypass the storage limits when importing large data volumes in
development environments.
C. Developer and Developer Pro sandboxes have different storage limits.
D. Data import wizard is a client application provided by Salesforce.
Answer: C, D
4.A credit card company needs to implement the functionality for a service agent to process damaged
or stolen credit cards. When the customers call in, the service agent must gather many pieces of
information. A developer is tasked to implement this functionality.
What should the developer use to satisfy this requirement in the most efficient manner?
A. Apex trigger
B. Approval process
C. Screen-based flow
D. Lightning Component
Answer: C
5.Refer to the following code snippet for an environment that has more than 200 Accounts belonging
to the Technology' industry:
Which three statements are accurate about debug logs? Choose 3 answers
A. Debug log levels are cumulative, where FINE log level includes all events logged at the DEBUG,
INFO, WARN, and ERROR levels.
B. The maximum size of a debug log is 5 MB.
C. Only the 20 most recent debug logs for a user are kept.
D. Debug logs can be set for specific users, classes, and triggers.
E. System debug logs are retained for 24 hours.
Answer: C, D, E
The developer creates a test method that calls MyClase,myStartmethod directly, resulting in 81%
overall code coverage.
What happens wtier the developer tries to deploy the ... and two classes to production, assuming no
other code exists?
A. The deployment fails because the Apr- MgQM has no code coverage.
B. The deployment tails because no assertions mett made in the lest method.
C. The deployment passes became the Apex code has the requited 75% code coverage.
D. The deployment passes because both classes and the trigger were included ki the deployment.
Answer: A
7.The Job_Application__c custom object has a field that is a Master-Detail relationship to the Contact
object, where the Contact object is the Master. As part of a feature implementation, a developer
needs to retrieve a list containing all Contact records where the related Account Industry is
‘Technology’ while also retrieving the contact’s Job_Application__c records.
Based on the object’s relationships, what is the most efficient statement to retrieve the list of
contacts?
A. [SELECT Id, (SELECT Id FROM Job_Applications_r) FROM Contact WHERE Account.Industry =
‘Technology’];
B. [SELECT Id, (SELECT Id FROM Job_Applications_r) FROM Contact WHERE Accounts.Industry =
‘Technology’];
C. [SELECT Id, (SELECT Id FROM Job_Applications_c) FROM Contact WHERE Accounts.Industry =
‘Technology’];
D. [SELECT Id, (SELECT Id FROM Job_Application_c) FROM Contact WHERE Account.Industry =
‘Technology’];
Answer: B
8.The Account object in an organization has a master detail relationship to a child object called
Branch.
The following automations exist:
• Rollup summary fields
• Custom validation rules
• Duplicate rules
A developer created a trigger on the Account object.
What two things should the developer consider while testing the trigger code? Choose 2 answers
A. Rollup summary fields can cause the parent record to go through Save.
B. The trigger may fire multiple times during a transaction.
C. Duplicate rules are executed once all DML operations commit to the database.
D. The validation rules will cause the trigger to fire again.
Answer: A, B
10.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?
A. Full Sandbox
B. Developer Edition
C. Partner Developer Edition
D. Developer Sandbox
Answer: A
11.A developer needs to prevent the creation of Request__c records when certain coVraitions exist in
the system. A RequeatLogic class exists that checks the conditions.
What is the correct implementation?
A)
B)
C)
D)
A. Option A
B. Option B
C. Option C
D. Option D
Answer: B
12.When a user edits the Postal Code on an Account, a custom Account text field named ''Timezone''
must be updated based on the values another custom object object called.
What is the optimal way to Implement this feature?
A. Build a flow with flow Builder.
B. Build an account assignment rule.
C. Create a formula field.
D. Create an account approval process.
Answer: A
13.Which two sfdx commands can be used to add testing data to a Developer sandbox?
A. Forced: data:bulk:upsert
B. Forced: data: object :upsert
C. Forced: data: tree: upsert
D. Forced: data:async:upsert
Answer: A, C
14.Which three code lines are required to create a Lightning component on a Visualforce page?
Choose 3 answers
A. $Lightning.createComponent
B. <apex:slds/>
C. $Lightning.useComponent
D. $Lightning.use
E. <apex:includeLightning/>
Answer: A, D, E
15.A develop completed modification to a customized feature that is comprised of two elements:
Apex trigger
Trigger handler Apex class
What are two factors that the developer must take into account to properly deploy the modification to
the production environment?
A. Apex classes must have at least 75% code coverage org-wide.
B. At least one line of code must be executed for the Apex trigger.
C. All methods in the test classes must use @isTest.
D. Test methods must be declared with the testMethod keyword.
Answer: A, B
16.n org has an existing flow that creates an Opportunity with an Update Records element. A
developer must update the flow to aiso create a ‘Contact and store the created Contact's 1D on the
Opportunity.
Which update must the developer make in the flow?
A. Add a new Get Records element.
B. Add a new Create Records element.
C. Add a new Update Records element.
D. Add a new Roll back Records element
Answer: B
17.For which three items can a trace flag be configured? Choose 3 answers
A. Process Builder
B. Visualforce
C. Apex Class
D. Apex Trigger
E. User
Answer: C, D, E
18.A developer Is asked to create a Visualforce page that lists the contacts owned by the current
user.
This component will be embedded In a Lightning page.
Without writing unnecessary code, which controller should be used for this purpose?
A. Standard list controller
B. Standard controller
C. Lightning controller
D. Custom controller
Answer: B
19.A lead developer creates an Apex interface called "Laptop". Consider the following code snippet:
How can a developer use the Laptop Interface within the Silvertaptop class?
A. @Extends(class=Laptop'') public class SilverLaptop
B. public calss SilverLaptop extends Laptop
C. @Interface (class=''Laptop'')
public class SilverLaptop
D. public class Silverlaptop implements Laptop
Answer: B
20.A developer wrote Apex code that calls out to an external system.
How should a developer write the test to provide test coverage?
A. Write a class that extends HTTPCalloutMock.
B. Write a class that implements the HTTPCalloutMock interface.
C. Write a class that implements the WebserviceMock interface.
D. Write a class that extends WebserviceMock
Answer: B
21.A primaryid_c custom field exists on the candidate_c custom object. The filed is used to store each
candidate's id number and is marked as Unique in the schema definition.
As part of a data enrichment process. Universal Containers has a CSV file that contains updated data
for all candidates in the system, the file contains each Candidate's primary id as a data point.
Universal Containers wants to upload this information into Salesforce, while ensuring all data rows
are correctly mapped to a candidate in the system.
Which technique should the developer implement to streamline the data upload?
A. Create a Process Builder on the Candidate_c object to map the records.
B. Create a before Insert trigger to correctly map the records.
C. Update the primaryid__c field definition to mark it as an External Id
D. Upload the CSV into a custom object related to Candidate_c.
Answer: C
22.A developer writes a trigger on the Account object on the before update event that increments a
count field. A workflow rule also increments the count field every time that an Account is created or
updated. The field update in the workflow rule is configured to not re-evaluate workflow rules.
What is the value of the count field if an Account is inserted with an initial value of zero, assuming no
other automation logic is implemented on the Account?
A. 1
B. 3
C. 4
D. 2
Answer: D
23.A custom object Trainer_c has a lookup field to another custom object Gym___c.
Which SOQL query will get the record for the Viridian City gym and it's trainers?
A. SELECT Id, (SELECT Id FROM Trainers) FROM Gym_C WHERE Name . Viridian City Gym'
B. SELECT Id, (SELECT Id FROM Trainer_c) FROM Gym_c WHERE Name - Viridian City Gym'
C. SELECT ID FROM Trainer_c WHERE Gym__r.Name - Viridian City Gym'
D. SELECT Id, (SELECT Id FROM Trainers) FROM Gym_C WHERE Name - Viridian City Gym'
Answer: A
24.A custom Visualforce controller calls the ApexPages,addMessage () method, but no messages are
rendering on the page.
Which component should be added to the Visualforce page to display the message?
A. <apex: pageMessages />
B. <apex: pageMessage severity=”info’’/>
C. <Apex: facet name=’’ message’’/>
D. <Apex: message for=’’ info’’/>
Answer: A
25.What are two ways a developer can get the status of an enquered job for a class that queueable
interface? Choose 2 answers
A. View the apex status Page
B. View the apex flex Queue
C. View the apex Jobs page
D. Query the AsyncApexJobe object
Answer: B, D
26.A developer must troubleshoot to pinpoint the causes of performance issues when a custom page
loads in their org.
Which tool should the developer use to troubleshoot?
A. AppExchange
B. Salesforce CLI
C. Visual Studio Core IDE
D. Developer Console
Answer: D
27.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?
A. Record-triggered flow
B. Formula field
C. Apex trigger
D. Field Update actions
Answer: B
28.A developer is alerted to an issue with a custom Apex trigger that is causing records to be
duplicated.
What is the most appropriate debugging approach to troubleshoot the issue?
A. Disable the trigger m production and test to see If the issue still occurs.
B. Use the Apex Interactive Debugger to step through the code and Identify the issue.
C. Review the Historical Event logs to Identify the source of the issue.
D. Add system.debug statements to the code to track the execution flow and identify the issue.
Answer: D
29.Universal Containers decides to use exclusively declarative development to build out a new
Salesforce application.
Which three options should be used to build out the database layer for the application? Choose 3
answers
A. Roll-Up Summaries
B. Triggers
C. Relationships
D. Flow
E. Custom Objects and Fields
Answer: A, C, E
30.Consider the following code snippet for a Visualforce page that is launched using a Custom Button
on the Account detail page layout.
When the Save button is pressed the developer must perform a complex validation that involves
multiple objects and, upon success, redirect the user to another Visualforce page.
What can the developer use to meet this business requirement?
A. Custom controller
B. Controller extension
C. Validation rule
D. Apex trigger
Answer: B
31.A Salesforce Administrator used Flow Builder to create a flow named ‘’accountOnboarding’’.
The flow must be used inside an Aura component.
Which tag should a developer use to display the flow in the component?
A. Lightning-flow
B. Aura:flow
C. Lightning:flow
D. Aura:flow
Answer: C
32.How can a developer check the test coverage of active Process Builder and Flows deploying them
in a Changing Set?
A. Use the Flow properties page.
B. Use the code Coverage Setup page
C. Use the Apex testresult class
D. Use SOQL and the Tooling API
Answer: D
33.In the following example, which starting context will mymethod execute it is invoked?
34.What is the value of the Trigger.old context variable in a before insert trigger?
A. A list of newly created sObjects without IDs
B. null
C. Undefined
D. An empty list of sObjects
Answer: D
35.Which Apex class contains methods to return the amount of resources that have been used for a
particular governor, such as the number of DML statements?
A. Exception
B. Messaging
C. OrgLimits
D. Limits
Answer: D
36.A developer wants to mark each Account in a List<Account> as either or Inactive based on the
LastModified field value being more than 90 days.
Which Apex technique should the developer use?
A. A for loop, with a switch statement inside
B. A Switch statement, with a for loop inside
C. An If/else statement, with a for loop inside
D. A for loop, with an if/else statement inside
Answer: D