Salesforce Plat-Dev-301 Practice Exam Questions & Answers

7 Free Questions · Last reviewed: October 19, 2026 · Prepared & Reviewed by the ValidExamDumps Editorial Team

Exam Facts

Salesforce Plat-Dev-301 Exam Details

Key details for this exam, checked against the published exam outline

161 Practice Questions (Our Bank)
120 minutes Exam Duration
63% Passing Score
USD 200 Official Exam Fee
Exam Code
Plat-Dev-301
Full Name
Salesforce Certified Platform Developer II
Issuing Body
Salesforce
Question Format (Our Bank)
Multiple Choice
Delivery
Online proctored or at a testing center
Eligibility
Must hold Salesforce Certified Platform Developer I certification
Validity
Does not expire as long as yearly maintenance requirements are completed
Practice Questions

Free Plat-Dev-301 Practice Questions

Each question shows the correct answer and an explanation of why it is right

VA
ValidExamDumps Editorial Team Every question and its answer is checked by our Plat-Dev-301 exam preparation team, who also write the explanation shown with each one. How we research and review these pages

A Salesforce org has more than 50,000 contacts. A new business process requires a calculation that aggregates data from all of these contact records. This calculation needs to run once a day after business hours. Which two steps should a developer take to accomplish this?

Correct Answer: B, C
Explanation

This scenario presents two distinct requirements: processing a large volume of data (50,000 records) and running the process at a specific time (once a day after business hours).

Database.Batchable (Option B): Processing 50,000 records in a single synchronous transaction will exceed Apex Governor Limits (specifically the CPU time limit or the heap size limit). Batch Apex allows the system to process these records in smaller chunks (batches), ensuring that the calculation completes without hitting limits.

Schedulable (Option C): To ensure the job runs 'once a day after business hours,' the Schedulable interface is required. The developer allows the class to be scheduled via the Apex Scheduler or the UI.

The standard pattern for this use case is to create a class that implements Schedulable, and inside its execute method, instantiate and execute the Batch class (Database.executeBatch). This combines precise timing with bulk processing capabilities.

A developer needs to add code to a Lightning web component's configuration file so the component only renders for a desktop size form factor when on a record page. What should the developer add to the component's record page target configuration to meet this requirement?

Correct Answer: A
Explanation

In a Lightning Web Component's configuration file (.js-meta.xml), the <supportedFormFactors> tag allows the developer to specify which device form factors the component supports. To restrict the component to only render on desktop devices, the developer must specify the type='Large'.

The structure is:

XML

<targetConfigs>

<targetConfig targets='lightning__RecordPage'>

<supportedFormFactors>

<supportedFormFactor type='Large'/>

</supportedFormFactors>

</targetConfig>

</targetConfigs>

If supportedFormFactors is not specified, the component defaults to supporting both Small (phone) and Large (desktop) form factors. Options B, C, and D are incorrect syntax for defining form factor support in LWC metadata.

A developer is building a Lightning web component that retrieves data from Salesforce and assigns it to the record property:

JavaScript

import { LightningElement, api, wire } from 'lwc';

import { getRecord } from 'lightning/uiRecordApi';

export default class Record extends LightningElement {

@api fields;

@api recordId;

record;

}

What must be done in the component to get the data from Salesforce?

Correct Answer: D
Explanation

To retrieve record data in a Lightning Web Component using the Lightning Data Service (LDS), the developer must use the @wire decorator with the getRecord wire adapter.

Option D provides the correct syntax. The @wire decorator requires the adapter name (getRecord) and a configuration object. The configuration must include the recordId and either the fields or layoutTypes to be retrieved. By using the $ prefix (e.g., '$recordId'), the developer makes the property 'reactive.' This means that whenever the value of recordId or fields changes, the wire service automatically re-provisions the data from Salesforce.

Options A and C are incorrect because @api is used to expose public properties, not for wiring data. Option B is incorrect because getRecord requires a field list or layout type to know which data points to fetch from the server. Using the reactive $fields ensures that the component remains flexible and can load different field sets as defined by its parent component.

MyOpportunities.js

JavaScript

import { LightningElement, api, wire } from 'lwc';

import getOpportunities from '@salesforce/apex/OpportunityController.findMyOpportunities';

export default class MyOpportunities extends LightningElement {

@api userId;

@wire(getOpportunities, {oppOwner: '$userId'})

opportunities;

}

OpportunityController.cls

Java

public with sharing class OpportunityController {

@AuraEnabled

public static List findMyOpportunities(Id oppOwner) {

return [

SELECT Id, Name, StageName, Amount

FROM Opportunity

WHERE OwnerId = :oppOwner

];

}

}

A developer is experiencing issues with a Lightning web component. The co12mponent must surface information about Opportunities owned by the currently logged-in user. When the component is rendered, the following message is displayed: "Error retrieving data". Which action must be completed in the Apex method to make it wireable?13

Correct Answer: C
Explanation

To use the @wire service in a Lightning Web Component (LWC) to retrieve data from an Apex method, the Apex method must be marked as cacheable. In the provided OpportunityController class, the findMyOpportunities method is annotated with @AuraEnabled, but it lacks the mandatory cacheable=true property.

The @wire service is part of the Lightning Data Service (LDS) reactive framework. Salesforce requires wireable methods to be cacheable to improve performance and ensure that data can be stored in the client-side cache. Without (cacheable=true), the @wire decorator will fail to execute, resulting in the 'Error retrieving data' message or a similar runtime failure.

Option C is the correct fix: the developer must update the annotation to @AuraEnabled(cacheable=true). Option A (Continuation) is only for long-running external callouts. Option B (without sharing) might affect visibility but isn't a requirement for the wire service itself. Option D (OWD) affects whether records are visible based on security, but the technical failure described is rooted in the component-to-Apex binding requirement. Once marked as cacheable, the LDS can properly manage the data lifecycle for the component.

As part of a custom interface, a developer team creates various new Lightning web components. Each of the components handles errors using toast messages. During acceptance testing, users complain about the long chain of toast messages that display when errors occur loading the components. Which two techniques should the developer implement to improve the user experience?

Correct Answer: A, C
Explanation

When multiple components on a single page all fail simultaneously (for example, due to a shared service failure), individual toast messages stack up, creating a poor user experience. To resolve this, developers should shift away from 'ephemeral' notifications like toasts toward more structured error handling.

Option A involves creating a dedicated error-handling component. This component can act as a listener or a central repository for errors across the page. Instead of each component firing its own toast, they can communicate their error state to this central component, which aggregates the messages into a single, clean display. This reduces visual clutter and allows the user to read all errors in one place.

Option C refers to 'in-place' error handling. Using conditional rendering (the lwc:if or template if:true directives), a component can hide its normal UI and display an error message exactly where the component would have been. This provides immediate context to the user about which specific part of the page failed without interrupting the overall flow with pop-ups.

Option B (window.alert) is considered a legacy practice that blocks the browser thread and is generally avoided in modern web development. Option D (public properties) is a mechanism for component communication but doesn't solve the display problem itself. Combining A and C provides a modern, professional, and less intrusive error-handling strategy.

Given the following containment hierarchy:

HTML

What is the correct way to communicate the new value of a property named "passthrough" to my-parent-component if the property is defined within my-child-component?

Correct Answer: C
Explanation

In Lightning Web Components (LWC), data flows 'down' via properties and 'up' via events. When a child component needs to communicate a change in a property or state to its parent, it must dispatch a CustomEvent. To pass specific data---such as the new value of the passthrough property---along with the event, the developer must use the detail property within the event initialization object.

Option C is the correct syntax. It creates a new CustomEvent named 'passthrough' and assigns the current value of the component's property (this.passthrough) to the detail key. The parent component can then listen for this event (using onpassthrough={handleEvent}) and access the value via event.detail. Option A is incorrect because it wraps the variable in quotes, passing the literal string 'this.passthrough' instead of the actual data. Option B creates an event but fails to include the data payload, meaning the parent would know an event occurred but wouldn't receive the new value. Option D uses incorrect syntax for event naming and variable referencing. Using the standard CustomEvent constructor with the detail property is the platform-standard way to ensure robust, typed data communication between component layers in the Shadow DOM.

A developer sees test failures in the sandbox but not in production. No code or metadata changes have been actively made to either environment since the sandbox was created. Which consideration should be checked to resolve the issue?

Correct Answer: C
Explanation

When code behavior differs between two environments that theoretically share the same codebase, the root cause is often the underlying platform version. Salesforce releases updates (e.g., Spring, Summer, Winter) on a staggered schedule. Sandbox instances are frequently updated to the 'Preview' version of the upcoming release weeks before the Production environment.

If a sandbox is on a newer release (Option C), it may include changes to the Apex compiler, new platform governor limits, or modifications to how standard objects behave. If a test relies on a specific behavior that changed in the new release, it might fail in the sandbox while still passing in the older Production environment.

Option A (SeeAllData=true) is a poor practice and would likely cause more issues rather than resolve them. Option B is unlikely because API versions are fixed in the metadata of the class and wouldn't change spontaneously. Option D relates to execution speed and resource contention but rarely causes a functional test to pass in one environment and fail in another unless there are significant race conditions. Checking the release version is the standard first step when diagnosing environment-specific discrepancies in the absence of code changes.

Full Access

Get the complete Plat-Dev-301 question set

  • 161 questions covering all exam domains
  • Correct answers with explanations, like the free questions above
  • PDF and online practice test
  • 90 days of free updates
Starting from 50% OFF
$20 $40
Get Full Access

One-time payment · Instant download

Study Guide

What the Salesforce Plat-Dev-301 Exam Covers

Exam domains verified against: Official Salesforce Plat-Dev-301 exam guide, last checked October 2026.

Domain 1: Advanced Developer Fundamentals 15%

Understand localization and multi-currency features and their coding implications. Learn when to use sharing objects and Apex managed sharing, and how to select appropriate custom metadata and custom settings implementations.

Sample questions from this domain above: Q2Q3

Domain 2: Process Automation, Logic, and Integration 27%

Master interactions between declarative and programmatic processes. Develop expertise in Apex triggers, error handling, advanced SOQL, asynchronous Apex, dynamic Apex features, platform events, and integration techniques for both inbound and outbound communication.

Sample questions from this domain above: Q1Q5

Domain 3: User Interface 20%

Analyze Apex controllers for Lightning web components and Aura components. Build responsive components across devices, handle error display, communicate between components, and use static resources effectively in Visualforce, LWC, and Aura.

Domain 4: Testing, Debugging, and Deployment 20%

Apply advanced testing techniques including mocks and stubs for Apex. Debug Lightning components, Visualforce, and JavaScript. Isolate root causes in non-executing code and formulate source-driven deployment processes using appropriate tools.

Sample questions from this domain above: Q4Q6Q7

Domain 5: Performance 18%

Identify UI performance issues and mitigation techniques. Optimize query structure for large data volumes. Recognize where asynchronous callouts improve performance and code reuse opportunities. Resolve inefficiencies in sample code.

FAQ

Plat-Dev-301 Exam FAQ

Common questions about the exam itself

Do I need the Platform Developer I certification before taking Plat-Dev-301?
Yes, you must hold the Salesforce Certified Platform Developer I certification to be eligible for the Platform Developer II exam. This prerequisite ensures you have the foundational programmatic development skills needed for the advanced material.
How hard is Plat-Dev-301 compared to Platform Developer I?
Platform Developer II is significantly more challenging. It tests advanced architectural patterns, complex integrations, optimization at scale, and decision-making about declarative versus programmatic approaches. Most candidates find the Performance and Process Automation domains the most difficult because they require deep understanding of governor limits and trade-offs.
How long should I prepare for Plat-Dev-301?
Most candidates spend 2-4 months preparing if they have solid Platform Developer I experience. The exam requires not just knowledge but practical problem-solving skills, so hands-on time building proof-of-concept solutions in a dev org is more valuable than passive study.
What is the passing score for Plat-Dev-301?
The passing score is 63 percent. You have 120 minutes to answer 60 multiple-choice and multiple-select questions, so time management matters.
Does Plat-Dev-301 certification expire?
The certification does not expire permanently, but it becomes inactive if you skip the yearly maintenance requirements. Salesforce releases three updates per year (Spring, Summer, Winter), and you must complete the relevant maintenance module within about 30 days of its release to keep your certification active.
Can I take Plat-Dev-301 online or do I need to go to a testing center?
You can take the exam either online with remote proctoring or in person at a Salesforce certified testing center. Both options are monitored to ensure a consistent and secure experience.
What is the biggest difference between Platform Developer II and Architect certifications?
Platform Developer II focuses on deep technical implementation skills for a single project or organization. Architect certifications test your ability to design multi-org, enterprise-scale solutions and make strategic technology decisions across many systems.
Why do so many people fail Plat-Dev-301 on their first attempt?
The exam heavily tests scenario-based decisions rather than just syntax knowledge. Candidates often underestimate the importance of understanding governor limits, transaction boundaries, and when to use async Apex, batch jobs, or scheduled actions. Real-world experience matters more than memorization.
What happens if I fail the Plat-Dev-301 exam?
You can retake the exam, but you must wait 14 days before your next attempt. The retake fee is half the original exam price, so USD 100 if the standard fee is USD 200.
How does Plat-Dev-301 relate to the MuleSoft Developer certification?
Plat-Dev-301 covers integration techniques on the Salesforce platform including REST and SOAP callouts, platform events, and batch data sync. MuleSoft Developer certification is for developers building integrations in MuleSoft Anypoint Platform, which sits alongside Salesforce in larger integration architectures. Platform Developer II teaches enough integration to pass, but MuleSoft DevOps or architecture roles may require MuleSoft certification instead.