Salesforce certification practice

Plat-Dev-301 Practice Questions

Try 10 free Plat-Dev-301 exam-style questions for Salesforce Certified Platform Developer II (PDII). Check each answer and review the explanation and source references.

Exam code
Plat-Dev-301
Provider
Salesforce
Free questions
10
Full set
160 questions
Last update check

Dive into our fully updated and highly reliable PLAT-DEV-301 practice test platform, where we feature all the latest Salesforce Platform Developer III exam questions added just this week. Our Cert Mage preparation tool is designed to be much more than a standard study aid; we provide you with a genuine strategic advantage. Our free PLAT-DEV-301 practice questions are meticulously crafted to reflect the precise knowledge domains and difficulty level of the actual Salesforce exam. You will greatly appreciate our detailed rationales that explain the exact ‘why’ behind each correct and incorrect answer, fundamentally reinforcing your core coding concepts. Use our interactive quizzes to easily pinpoint which specific development areas you need to focus your studies on next.

Which use case can be performed only by using asynchronous Apex?
Answer options

The Account object has a field, Audit_Code__c, that is used to specify what type of auditing the

Account needs and a Lookup to User, Auditor__c, that is the assigned auditor. When an Account is

initially created, the user specifies the Audit_Code__c. Each User in the org has a unique text field,

Audit_Code__c, that is used to automatically assign the correct user to the Account's Auditor__c

field.

Trigger:

Java

trigger AccountTrigger on Account (before insert) {

AuditAssigner.setAuditor(Trigger.new);

}

Apex Class:

Java

public class AuditAssigner {

public static void setAuditor(List<Account> accounts) {

for (User u : [SELECT Id, Audit_Code__c FROM User]) {

for (Account a : accounts) {

if (u.Audit_Code__c == a.Audit_Code__c) {

a.Auditor__c = u.Id;

}

}

}

}

}

What should be changed to most optimize the code's efficiency?

Answer options
How should a developer verify that a specific Account record is being tested in a test class for a Visualforce controller?
Answer options
There is an Apex controller and a Visualforce page in an org that displays records with a custom filter consisting of a combination of picklist values selected by the user. The page takes too long to display results for some of the input combinations, while for other input choices it throws the exception, "Maximum view state size limit exceeded". What step should the developer take to resolve this issue?
Answer options
A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that users encounter "View State" errors when using it in production. What should the developer ensure to correct these errors?
Answer options
Refer to the code below: Lightning Web Component JS file JavaScript import {LightningElement} from 'lwc'; import serverEcho from '@salesforce/apex/SimpleServerSideController.serverEcho'; export default class Helloworld extends LightningElement { firstName = 'world'; handleClick() { serverEcho({ firstName: this.firstName }) .then((result) => { alert('From server: ' + result); }) .catch((error) => { console.error(error); }); } } Apex Controller Java public with sharing class SimpleServerSideController { @AuraEnabled public static String serverEcho(sObject firstName) { String firstNameStr = (String)firstName.get('firstName'); return ('Hello from the server, ' + firstNameStr); } } Given the code above, which two changes need to be made in the Apex Controller for the code to work?
Answer options

A developer is developing a reusable Aura component that will reside on an sObject Lightning page

with the following HTML snippet:

HTML

<aura:component implements="force:hasRecordId,flexipage:availableForAllPageTypes">

<div>Hello!</div>

</aura:component>

How can the component's controller get the context of the Lightning page that the sObject is on

without requiring additional test coverage?

Answer options
Millions of Accounts are updated every quarter from an external system. What is the optimal way to update these in Salesforce?
Answer options

Refer to the Aura component below: HTML

<aura:component>

<aura:attribute name="contactInfo" type="Object"/>

<aura:attribute name="showContactInfo" type="boolean" default="true"/>

<aura:handler name="init" value="{!this}" action="{!c.init}"/>

<aura:if isTrue="{!v.showContactInfo}">

<c:contactInfo value="{!v.contactInfo}"/>

</aura:if>

</aura:component>

A developer receives complaints that the component loads slowly. Which change can the developer

implement to make the component perform faster?

Answer options
A Visualforce page loads slowly due to the large amount of data it displays. Which strategy can a developer use to improve the performance?
Answer options
Question 1 of 10

Source context

How this practice set is maintained

Maintained by the CertMage content team, this page loads questions from the exam dataset connected to its preparation resource. When an answer includes a supporting reference, it is shown with that answer so you can review the underlying vendor documentation.

Certification objectives, interfaces, and vendor services can change. Verify important details against the provider's current exam guide and documentation before your exam.

Scroll to Top