Free Plat-Dev-201 Practice Test Questions and Answers (2026) | Cert Empire Practice Questions

Free preview: 20 questions.

Already purchased? Log in

Salesforce Plat Dev 201

View Mode
Q: 1
What is the result of the following code? Salesforce Plat Dev 201 question
Options
Q: 2
How should a developer write unit tests for a private method in an Apex class?
Options
Q: 3
A developer needs to have records with specific field values in order to test a new Apex class. What should the developer do to ensure the data is available to the test?
Options
Q: 4
A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple sObjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URL. Which three statements are useful inside the unit test to effectively test the custom controller? Choose 3 answers
Options
Q: 5
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?
Options
Q: 6
The following Apex method is part of the ContactService class that is called from a trigger: Salesforce Plat Dev 201 question How should the developer modify the code to ensure best practices are met? A) Salesforce Plat Dev 201 question B) Salesforce Plat Dev 201 question C) Salesforce Plat Dev 201 question D)
Options
Q: 7
When using Salesforce DX, what does a developer need to enable to create and manage scratch orgs?
Options
Q: 8
A custom picklist field, Pool Preference ¢, exists on a custom object. The picklist contains the following options: ‘Vegan’, ‘Kosher’, 'No Preference’. The developer must ensure a value is populated every time a record is created or updated. What is the optimal way to ensure a value is selected every time a record is saved?
Options
Q: 9
Cloud Kicks Fitness, an ISV Salesforce partner, is developing a managed package application. One of the application modules allows the user to calculate body fat using the Apex class, Bodyfat, and its method, calculateBodyFat (). The product owner wants to ensure this method is accessible by the consumer of the application when developing customizations outside the ISV's package namespace. Which approach should a developer take to ensure calculateBodyFat () is accessible outside the package namespace?
Options
Q: 10
Since Aura application events follow the traditional publish-subscribe model, which method is used to fire an event?
Options
Q: 11
Consider the following code snippet: apex CopyEdit public class with sharing AccountsController { @AuraEnabled public List getAllAccounts(){ return [SELECT Id, Name, Industry FROM Account]; } } Apex Test Class Snippet: apex CopyEdit @isTest private class with sharing AccountsController_Test { @testSetup private static void makeData(){ User user1 = [SELECT Id FROM User WHERE Profile.Name = 'System Administrator' AND isActive = true LIMIT 1]; User user2 = [SELECT Id FROM User WHERE Profile.Name = 'Standard User' AND UserName = '[email protected]' AND isActive = true LIMIT 1]; TestUtils.insertAccounts(10, user1.Id); TestUtils.insertAccounts(20, user2.Id); } @isTest private static void getAllAccounts_StandardUser_Test(){ List result = AccountsController.getAllAccounts(); System.assertEquals(20, result.size()); } } When the test class runs, the assertion fails. Which change should the developer implement in the Apex test method to ensure the test method executes successfully?
Options
Q: 12
A developer needs to confirm that a Contact trigger works correctly without changing the organization's data. What should the developer do to test the Contact trigger?
Options
Q: 13
Which three steps allow a custom Scalable Vector Graphic (SVG) to be included in a Lightning web component? Choose 3 answers
Options
Q: 14
Which code in a Visualforce page and/or controller might present a security vulnerability?
Options
Q: 15
Which two are phases in the Aura application event propagation framework? Choose 2 answers
Options
Q: 16
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?
Options
Q: 17
Consider the following code snippet: public static List obtainAllFields(Set leadIds) { List result = new List(); for (Id leadId : leadIds) { result.add([SELECT FIELDS(ALL) FROM Lead WHERE Id = :leadId]); } return result; } Given the multi-tenant architecture of the Salesforce platform, what is a best practice a developer should implement to ensure successful execution of the method?
Options
Q: 18
Universal Hiring uses Salesforce to capture job applications. A salesforce administrator created two custom objects; Job__c acting as the master object, to Application_c acting as the detail. Within the Job__c object, a custom multi-select picklist, preferred _Locations__c, contains a list of approved states for the position. Each Job_Application__c record relates to a Contact within the system through a master-detail relationship. Recruiters have requested the ability to view whether the Contact's Mailing State value matches a value selected on the Preferred Locations__c field, within the Job_Application__c record. Recruiters would like this value to be kept in sync if changes occur to the Contact's Mailing State. What is the recommended tool a developer should use to meet the business requirement?
Options
Q: 19
A development team wants to use a deployment script to automatically deploy to a sandbox during their development cycles. Which two tools can they use to run a script that deploys to a sandbox? Choose 2 answers
Options
Q: 20
A developer considers the following snippet of code: Boolean isOK; Integer x; String theString = 'Hello'; if (isOK == false && theString == 'Hello') { x = 1; } else if (isOK == true && theString == 'Hello') { x = 2; } else if (isOK == null && theString == 'Hello') { x = 3; } else { x = 4; } Based an this code, what is the value of x?
Options
Question 1 of 20

Premium Access Includes

  • Quiz Simulator
  • Exam Mode
  • Progress Tracking
  • Question Saving
  • Flash Cards
  • Drag & Drops
  • 3 Months Access
  • PDF Downloads
Get Premium Access
Scroll to Top

FLASH OFFER

Days
Hours
Minutes
Seconds

avail 10% DISCOUNT on YOUR PURCHASE