Salesforce PDI Online Practice
Questions and Exam Preparation
PDI Exam Details
Exam Code
:PDI
Exam Name
:Salesforce Certification for Platform Developer I (Plat-Dev-201)
Certification
:Salesforce Certifications
Vendor
:Salesforce
Total Questions
:270 Q&As
Last Updated
:May 25, 2026
Salesforce PDI Online Questions &
Answers
Question 151:
A developer is implementing an Apex class for a financial system. Within the class, the variables 'creditAmount' and 'debitAmount' should not be able to change once a value is assigned.
In which two ways can the developer declare the variables to ensure their value can only be assigned one time? Choose 2 answers
A. Use the static keyword and assign its value in a static initializer. B. Use the final keyword and assign its value in the class constructor. C. Use the final keyword and assign its value when declaring the variable. D. Use the static keyword and assign its value in the class constructor.
B. Use the final keyword and assign its value in the class constructor. C. Use the final keyword and assign its value when declaring the variable.
Explanation
Why Use final ?
The final keyword ensures that a variable's value can only be assigned once.
Option B: Assigning the value in the constructor is valid as it allows for flexibility when creating class instances.
Option C: Assigning the value directly when declaring the variable is also valid for constants.
Why Not Other Options?
A: Static variables can have their values reassigned unless marked as final.
D: Static variables cannot be assigned within a class constructor.
Apex Final Keyword: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode /apex_classes_final.htm
Question 152:
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. OrgLimits B. Limits C. Messaging D. Exception
B. Limits
Explanation
The Limits class in Apex provides methods to check the consumption of governor limits, such as the number of SOQL queries, DML statements, and heap size used.
Option C: Messaging deals with email and messaging operations.
Option D: Exception is for handling exceptions, not tracking resource usage.
Question 153:
Refer to the component code 9f\d requirements below:
Requirements
1. For mobile devices.the information should display in three rows.
2. For desktops and tablets, the information should display in a single row.
Requirement 2 is not displaying as desired.
Which option has the correct component code to meet the requirements for desktops end and tablets?
A. Option A B. Option B C. Option C D. Option D
B. Option B
Explanation
Question 154:
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 all it's trainers?
A. SELECT ID FROM Trainer_c WHERE Gym_r.Name = 'Viridian City Gym' B. SELECT Id, (SELECT Id FROM Trainer_c FROM Gym_c WHERE Name = `Viridian City Gym" C. SELECT Id, (SELECT Id FROM Trainers _r) FROM Gym_c WHERE Name = `Viridian City Gym' D. SELECT Id, (SELECT Id FROM Trainers _c) FROM Gym_c WHERE Name = 'Viridian City Gym'
C. SELECT Id, (SELECT Id FROM Trainers _r) FROM Gym_c WHERE Name = `Viridian City Gym'
Explanation
To query related child records in a lookup or master-detail relationship:
Use the parent object (Gym__c) to retrieve its child records (Trainer__c) through a nested query.
The child relationship name (Trainers__r) is derived from the lookup field.
Question 155:
Which two events need to happen when deploying to a production org? Choose 2 answers
A. All custom objects must have visibility set to a value other than in Development. B. All Apex code must have at least 75% test coverage. C. All triggers must have some test coverage D. All Visual flows must have at least 1% test coverage.
B. All Apex code must have at least 75% test coverage. C. All triggers must have some test coverage
Explanation
B: Salesforce requires that all Apex code have at least 75% test coverage in production before deployment. This ensures that the system remains reliable.
C: All triggers must have some test coverage as part of the overall 75% requirement for Apex code.
Why not other options?
A: Object visibility settings are not a deployment requirement.
D: Visual Flows do not require test coverage for deployment to production.
References:Apex Test Coverage Requirements
Question 156:
What are two considerations for deploying from a sandbox to production? Choose 2 answers
A. At least 75% of Apex code must be covered by unit tests. B. Unit tests must have calls to the System.assert method. C. Should deploy during business hours to ensure feedback can be quickly addressed. D. All triggers must have at least one line of test coverage.
A. At least 75% of Apex code must be covered by unit tests. D. All triggers must have at least one line of test coverage.
Explanation
A. 75% Test Coverage: Salesforce mandates that 75% of all Apex code must be covered by tests to be deployable to production.
D. Trigger Coverage: Each Apex trigger must have at least one line of test coverage to ensure it is properly tested.
Question 157:
Universal Containers implemented a private sharing model for the Account object. A custom Account search tool was developed with Apex to help sales representatives find accounts that match multiple criteria they specify. Since its release, users of the tool report they can see Accounts they do not own.
What should the developer use to enforce sharing permissions for the currently logged in user while using the custom search tool?
A. Use the with sharing keyword on the class declaration. B. Use the without sharing keyword on the class declaration. C. Use the userInfo Apex class to filter all SOQL queries to returned records owned by the logged-in user. D. Use the schema describe calls to determine if the logged-in user has access to the Account object.
A. Use the with sharing keyword on the class declaration.
Explanation
The with sharing keyword ensures that the Apex class respects the sharing rules of the current user, including private sharing models. This means the logged-in user will only see records they own or have been shared with them.
Question 158:
A company wants to implement a new call center process for handling customer service calls. It requires service reps to ask for the caller's account number before proceeding with the rest of their call script.
Following best practices, what is the optimal approach to satisfy this requirmrnt?
A. Flow Builder B. Approvals C. Apex trigger D. Einstein Next Best Action
A. Flow Builder
Explanation
Question 159:
A developer created a child Lightning web component nested inside a parent Lightning web component. The parent component needs to pass a string value to the child component.
In which two ways can this be accomplished? Choose 2 answers
A. The parent component can invoke a public method in the child component. B. The parent component can use a public property to pass the data to the child component, C. The parent can use the Apex controller class to send data to the child component. D. The parent component can use a custom event to pass the data to the child component.
A. The parent component can invoke a public method in the child component. B. The parent component can use a public property to pass the data to the child component,
Explanation
Public Method (A):The parent component can call a public method defined in the child component to pass data directly.
Question 160:
Which code displays the content of Visualforce page as PDF?
Nowadays, the certification exams become more and more important and required by more and more
enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare
for the exam in a short time with less efforts? How to get a ideal result and how to find the
most reliable resources? Here on Vcedump.com, you will find all the answers.
Vcedump.com provide not only Salesforce exam questions,
answers and explanations but also complete assistance on your exam preparation and certification
application. If you are confused on your PDI exam preparations
and Salesforce certification application, do not hesitate to visit our
Vcedump.com to find your solutions here.