IT Certifications · Plat-Dev-301

Salesforce Platform Dev2 Exam Practice Test

The Salesforce Platform Dev2 Exam practice page covers advanced Salesforce application development concepts, including Apex behavior, Visualforce controllers and extensions, Lightning Web Components, and testing. The practice-bank scenarios ask you to choose implementation patterns for tasks such as passing data between JavaScript and Apex, rendering conditional markup, scheduling Apex, and validating error handling.

Exam overview

Exam providerSalesforce
Exam codePlat-Dev-301
CategoryIT Certifications

About the Salesforce Platform Dev2 Exam

Development decisions in these scenarios involve selecting platform features that fit the execution context and the interface consuming the result. For Apex, that includes designing methods and return types for Lightning Web Components, handling structured inputs, parsing dates predictably, and reusing data within a transaction. Visualforce questions focus on controller properties and extension constructors that receive a standard controller. Component work includes choosing static resources for shared assets and template directives for conditional rendering. Testing scenarios emphasize asserting expected exceptions rather than merely exercising code. Together, these concepts relate to practical tasks such as exposing server-side logic to a component, avoiding redundant queries, building scheduled processing, and ensuring invalid inputs fail in a controlled way. The examples reflect the available practice bank’s vocabulary and should be treated as practice scenarios, not as a statement of official exam coverage.

Sample Practice Questions

Review a selection from this exam's published US Practice Tests practice bank.

Question 1

A Visualforce page uses an extension class alongside a standard controller. Which constructor signature allows the extension to receive the standard controller instance?

  1. AThe extension must have a constructor that accepts ApexPages.StandardController
  2. BThe extension must have a no-argument constructor only
  3. CThe extension must implement Database.Batchable
  4. DThe extension must define a static constructor
Show answerCorrect answer: A

A Visualforce controller extension receives the standard controller through a constructor parameter of type ApexPages.StandardController. This lets the extension add behavior while retaining standard-controller functionality.

Question 2

A developer needs to share a small set of static files, such as images and stylesheets, with a Lightning Web Component. Which Salesforce resource is designed for this purpose?

  1. AStatic resource
  2. BCustom label
  3. CCustom metadata type
  4. DPlatform event
Show answerCorrect answer: A

Static resources store files such as images, JavaScript libraries, and stylesheets for use by Salesforce pages and components. Custom labels are for translatable text, while custom metadata stores configuration records.

Question 3

A Lightning Web Component needs to display different markup depending on whether a Boolean property is true. Which template directive is intended for conditional rendering?

  1. Afor:each
  2. Blwc:dom
  3. Cif:true
  4. Dkey
Show answerCorrect answer: C

The if:true directive conditionally renders template content based on a Boolean expression. The other choices serve different purposes, such as list iteration or DOM management.

Question 4

A developer wants to avoid repeatedly querying the same parent record while processing several related records in one Apex transaction. Which feature can provide a transaction-scoped cache for data the application loads?

  1. APlatform Cache session partition
  2. BA static variable on an Apex class
  3. CA custom label
  4. DA future method
Show answerCorrect answer: B

A static variable persists for the lifetime of a single Apex transaction, so code can reuse data already loaded during that transaction. Platform Cache has a broader cache scope and configuration requirements; custom labels store text configuration, and future methods run asynchronously in another transaction.

Question 5

An Apex method needs to return a collection of records to a Lightning Web Component. Which return type is supported for a method exposed to LWC?

  1. AList<Account>
  2. BDatabase.QueryLocator
  3. CSystem.SaveResult
  4. DApexPages.StandardController
Show answerCorrect answer: A

An exposed Apex method can return supported Apex data types such as a list of sObjects. QueryLocator is intended for batch processing, while the other choices are not appropriate general LWC response types.

Question 6

A scheduled Apex class must be eligible to run through Salesforce's scheduler. Which interface must the class implement?

  1. ASchedulable
  2. BQueueable
  3. CDatabase.Batchable<sObject>
  4. DIterable<sObject>
Show answerCorrect answer: A

A class implements Schedulable and defines execute(SchedulableContext) to provide work for Salesforce's Apex scheduler. Queueable and Batchable support different asynchronous execution patterns.

Question 7

An Apex class needs to parse a date represented in a known textual format, such as year-month-day, rather than relying on locale-specific date formatting. Which method is appropriate?

  1. ADate.parse
  2. BDate.valueOf
  3. CDatetime.now
  4. DString.format
Show answerCorrect answer: B

Date.valueOf parses a date string in the standard year-month-day format. Date.parse uses locale-sensitive parsing, so it is not the best fit when the input format is explicitly standardized.

How to use this practice test

Access the practice questions for free. Each session draws up to 20 random questions from the published bank, which currently contains 50 questions. After completing a session, review the results to identify which Apex, Visualforce, Lightning Web Components, or testing concepts need closer attention.

Preparation tips

  • Practice tracing an Apex method call from a Lightning Web Component, including supported return types and how JavaScript supplies complex input values.
  • Compare Visualforce standard controllers, controller extensions, and exposed properties; write down the constructor signature an extension uses to receive its standard controller.
  • Build small examples that use a scheduled Apex interface, a transaction-scoped data cache, and explicit date parsing, then identify the purpose of each choice.
  • Write Apex tests that deliberately pass invalid input and assert the expected exception, so failure behavior is tested directly.
  • In a sample Lightning Web Component, import a static resource and use a Boolean condition to control which template markup renders.
Official sourceOfficial exam page ↗