Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Plat-Dev-301 Exam Questions

Exam Name: Salesforce Certified Platform Developer II Exam
Exam Code: Plat-Dev-301
Related Certification(s): Salesforce Platform Developer II Certification
Certification Provider: Salesforce
Number of Plat-Dev-301 practice questions in our database: 161 (updated: Aug. 02, 2026)
Expected Plat-Dev-301 Exam Topics, as suggested by Salesforce :
  • Topic 1: Advanced Developer Fundamentals: Covers coding for localization and multi-currency, using sharing objects and Apex managed sharing, and choosing the right custom metadata or custom settings approach.
  • Topic 2: Process Automation, Logic, and Integration: Covers designing and justifying declarative vs. programmatic automation, writing robust Apex triggers with proper error handling, using advanced SOQL, applying asynchronous and dynamic Apex, and implementing platform events and integration techniques.
  • Topic 3: User Interface: Covers building and troubleshooting Apex controllers for LWC/Aura, using Visualforce for actions and partial refreshes, handling UI errors, selecting the right UI technology, ensuring responsive design, managing component communication, and using static resources.
  • Topic 4: Testing, Debugging, and Deployment: Covers advanced Apex testing with mocks and stubs, testing/debugging LWC, Aura, Visualforce, and JavaScript, root-cause analysis of failing code, and source-driven deployment processes.
  • Topic 5: Performance: Covers identifying and fixing UI performance issues, optimizing queries and logic for large data volumes, improving performance via asynchronous callouts, applying code reuse, and identifying inefficiencies in sample code.
Disscuss Salesforce Plat-Dev-301 Topics, Questions or Ask Anything Related
0/2000 characters

Mark Evans

4 days ago
I passed Platform Developer II after focusing on integration patterns and async Apex, since the exam leaned heavily on when to use each option. Building small proof of concepts in a dev org helped the concepts stick far better than rereading notes.
upvoted 0 times
...

Laura Evans

11 days ago
Advanced Developer Fundamentals. Expect scenario-based code snippets that ask which governor limits will be hit or which pattern to use in a multi-transaction flow. Brush up on bulkification, transaction boundaries, common Apex patterns, and how limits behave across sync and async contexts.
upvoted 0 times
...

Free Salesforce Plat-Dev-301 Exam Actual Questions

Note: Premium Questions for Plat-Dev-301 were last updated On Aug. 02, 2026 (see below)

Question #1

To avoid duplicating code and improve maintainability, how should Universal Containers implement an API integration for code reuse?

Reveal Solution Hide Solution
Correct Answer: A

Comprehensive and Detailed 1

The fundamental principle of DRY (Don't Repeat Yourself) in Apex development dictates that logic used in multiple places should be centralized. For API integrations, this typically invo2lves creating a Utility or Service Class (Option A).

This class handles the common 'plumbing' of the integration:

Retrieving Named Credentials.

Setting headers (Content-Type, Timeout).

Standardizing error handling and logging.

Serializing and deserializing JSON payloads.

By invoking this central class from various triggers, batch jobs, or controllers, the developer ensures that any change to the API (such as a version update or header change) only needs to be made in one place. Option B leads to 'class sprawl' and duplicate boilerplate code. Option C is incorrect as Static Resources cannot contain executable Apex code. Option D is the definition of poor maintainability.


Question #2

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

Reveal Solution Hide Solution
Correct Answer: C

Comprehensive and Detailed

When dealing with Large Data Volumes (LDV)---specifically in the range of hundreds of thousands to millions of records---the Bulk API (Option C) is the only optimal choice.

The Bulk API is based on REST principles but is optimized for processing large sets of data asynchronously. Instead of processing records one by one or in small synchronous chunks (which would hit time limits and consume many API calls), the Bulk API allows you to upload a CSV file or JSON batch. Salesforce then processes these records in the background using parallel processing.

Options A and B (REST/SOAP) are designed for real-time, synchronous interactions with a limited number of records and would hit rate limits or timeout for millions of records. Option D is for custom logic and is subject to the same synchronous execution limits as standard REST.


Question #3

A large company uses Salesforce across several departments. Each department has its own Salesforce Administrator. It was agreed that each Administrator would have their own sandbox in which to test changes. Recently, users notice that fields that were recently added for one department suddenly disappear without warning. Which two statements are true regarding these issues and resolution?3637

Reveal Solution Hide Solution
Correct Answer: B, D

This scenario highlights a common conflict in multi-admin environments known as 'the last delivery wins' problem. When multiple administrators work in isolated sandboxes, they are essentially working on different versions of the same metadata. If Admin A adds a field to a Page Layout and deploys it, and then Admin B---who does not have Admin A's changes in their sandbox---deploys their own version of that same Page Layout, Admin B's deployment will overwrite Admin A's changes in Production (Statement B). In the Metadata API (which Change Sets use), Page Layouts are treated as single files; you cannot 'merge' them via a Change Set; you can only replace the destination file entirely.

To resolve this, the team needs a more sophisticated deployment pipeline. Statement D is the correct resolution: the company should implement a 'Staging' or 'Integration' sandbox. In this model, all admins deploy their Change Sets to a single unified sandbox first. This allows them to identify conflicts and 'merge' their changes (manually or via source control) before a final, combined deployment is made to Production. Statement A is technically incorrect because Change Sets cannot 'delete' components; they can only overwrite or add. Statement C is a myth; Page Layouts can be safely deployed, but only if the underlying fields and security settings are also included and coordinated.


Question #4

The use of the transient keyword in Visualforce page helps with which performance issue?

Reveal Solution Hide Solution
Correct Answer: A

In Visualforce, the 'View State' is a hidden form field that maintains the state of the page (and the controller's variables) across postbacks to the server. If the View State becomes too large, it can slow down page loads and eventually hit the Salesforce View State limit (170KB), causing the page to crash.

The transient keyword is used to declare instance variables in Apex controllers that should not be saved in the View State. When a variable is marked as transient, its value is discarded after the request finishes and is not transmitted back to the client. This effectively reduces the size of the View State. It is commonly used for data that is needed only for the duration of the current request (like a large list of records displayed in a read-only table) and can be easily requeried or recalculated if needed.


Question #5

Consider the following code snippet:

Java

01 public with sharing class AccountsController{

03 @AuraEnabled

04 public List getAllAccounts(){

05 return [Select Id, Name, Industry FROM Account];

06 }

08 }

As part of the deployment cycle, a developer creates the following test class:

Java

@isTest

private class AccountsController_Test{

@TestSetup

private static void makeData(){

User user1 = [Select Id FROM User WHERE Profile.Name = 'System Administrator' ... LIMIT 1];

User user2 = [Select Id FROM User WHERE Profile.Name = 'Standard User' ... LIMIT 1];

TestUtils.insertAccounts(10,user1.Id);

TestUtils.insertAccounts(20,user2.Id);

}

@isTest

private static void testGetAllAccounts(){

// Query the Standard User into memory

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?

Reveal Solution Hide Solution
Correct Answer: C

The failure of the assertion is caused by the with sharing keyword used in the AccountsController class and the context in which the test is running. The with sharing keyword enforces the sharing rules of the current user. In a test context, the code defaults to running as a System Administrator unless otherwise specified.

In the @TestSetup method, the developer created 10 accounts owned by a System Admin (user1) and 20 accounts owned by a Standard User (user2). When AccountsController.getAllAccounts() is called without a specific user context, it runs as the Admin and returns all 30 records. The assertion expects exactly 20 records (System.assertEquals(20, result.size())), which corresponds to the number of records owned by the Standard User.

To make the test pass, the developer must execute the method within the context of the Standard User. By querying user2 and using System.runAs(user2) (Option C), the sharing rules are enforced according to that user's perspective. Under with sharing, the Standard User will only 'see' the 20 account records they own (assuming a Private OWD and no other sharing rules apply), thus satisfying the assertion. Option A is incorrect as seeAllData=true bypasses the test isolation. Option D would result in a count of 30 (or 10 if restricted), which still fails the assertion.



Unlock Premium Plat-Dev-301 Exam Questions with Advanced Practice Test Features:
  • Select Question Types you want
  • Set your Desired Pass Percentage
  • Allocate Time (Hours : Minutes)
  • Create Multiple Practice tests with Limited Questions
  • Customer Support
Get Full Access Now

Save Cancel