Trailblaze Prep
All CertificationsCertification PathBecome a CTASearchContact Us

Choose your role

Associate
Administrator
Developer
Consultant
Marketing
Architect
Accredited Professional
Salesforce Certified Advanced Field Service Accredited ProfessionalSalesforce Certified B2B Commerce Admin Accredited ProfessionalSalesforce Certified B2B Commerce Developer Accredited ProfessionalSalesforce Certified Communications Cloud Accredited ProfessionalSalesforce Certified Consumer Goods Cloud Accredited ProfessionalSalesforce Certified Consumer Goods Cloud Trade Promotion Management Accredited ProfessionalSalesforce Certified Contact Center Accredited ProfessionalSalesforce Certified CPQ and Billing Consultant Accredited ProfessionalSalesforce Certified Energy and Utilities Cloud Accredited ProfessionalSalesforce Certified Financial Services Cloud Accredited ProfessionalSalesforce Certified Health Cloud Accredited ProfessionalSalesforce Certified Heroku Developer Accredited ProfessionalSalesforce Certified Loyalty Management Accredited ProfessionalSalesforce Certified Manufacturing Cloud Accredited ProfessionalSalesforce Certified Marketing Cloud Advanced Cross Channel Accredited ProfessionalSalesforce Certified Marketing Cloud Intelligence Accredited ProfessionalSalesforce Certified Marketing Cloud Personalization Accredited ProfessionalSalesforce Certified Media Cloud Accredited ProfessionalSalesforce Certified Net Zero Cloud Accredited ProfessionalSalesforce Certified Order Management Administrator Accredited ProfessionalSalesforce Certified Order Management Developer Accredited ProfessionalSalesforce Certified Process Automation Accredited ProfessionalSalesforce Certified Public Sector Solutions Accredited Professional
Sales
Designer
Tableau
Associate
Administrator
Developer
Consultant
Marketing
Architect
Accredited Professional
Salesforce Certified Advanced Field Service Accredited ProfessionalSalesforce Certified B2B Commerce Admin Accredited ProfessionalSalesforce Certified B2B Commerce Developer Accredited ProfessionalSalesforce Certified Communications Cloud Accredited ProfessionalSalesforce Certified Consumer Goods Cloud Accredited ProfessionalSalesforce Certified Consumer Goods Cloud Trade Promotion Management Accredited ProfessionalSalesforce Certified Contact Center Accredited ProfessionalSalesforce Certified CPQ and Billing Consultant Accredited ProfessionalSalesforce Certified Energy and Utilities Cloud Accredited ProfessionalSalesforce Certified Financial Services Cloud Accredited ProfessionalSalesforce Certified Health Cloud Accredited ProfessionalSalesforce Certified Heroku Developer Accredited ProfessionalSalesforce Certified Loyalty Management Accredited ProfessionalSalesforce Certified Manufacturing Cloud Accredited ProfessionalSalesforce Certified Marketing Cloud Advanced Cross Channel Accredited ProfessionalSalesforce Certified Marketing Cloud Intelligence Accredited ProfessionalSalesforce Certified Marketing Cloud Personalization Accredited ProfessionalSalesforce Certified Media Cloud Accredited ProfessionalSalesforce Certified Net Zero Cloud Accredited ProfessionalSalesforce Certified Order Management Administrator Accredited ProfessionalSalesforce Certified Order Management Developer Accredited ProfessionalSalesforce Certified Process Automation Accredited ProfessionalSalesforce Certified Public Sector Solutions Accredited Professional
Sales
Designer
Tableau

Updated for Winter '26

Salesforce Platform Developer II Study Guide (Winter '26): Complete PD2 Exam Prep

Platform Developer II is one of the most challenging Salesforce certifications. It goes beyond writing correct Apex — it tests your ability to architect scalable, performant solutions using design patterns, advanced async processing, integration patterns, and developer tooling. This guide covers every section with the depth needed to pass.

KM

Written and reviewed by Krishna Mohan — ADM-201, PD1, PD2, App Builder & Consultant certified. Updated for Winter '26. Methodology · Contact

PD2 Exam at a Glance

60

Questions

120 min

Time Limit

65%

Passing Score

$200

Exam Fee

PD1 certification required. 120-minute time limit (longer than most Salesforce exams — code-reading questions take more time). Retake fee: $100.

PD2 Exam Sections and Weightage

Design Patterns (25%) + Testing & Debugging (25%) = 50% of the exam. These two sections are where PD2 candidates most often fail — they are purely advanced technical topics not covered in PD1.

Design Patterns25%

Apex Enterprise Patterns (Selector, Service, Domain, Unit of Work), Singleton, Strategy, Decorator patterns applied to Apex, separation of concerns

Testing and Debugging25%

Advanced test isolation, mocking HTTP callouts (HttpCalloutMock), testing async Apex (Test.startTest/stopTest), testing mixed DML, debug log analysis, query plan tool

Integration23%

REST and SOAP callouts from Apex, Named Credentials, platform events, streaming API, external services, inbound REST API (Apex REST)

Performance17%

SOQL query optimisation, selective queries and indexes, heap size management, CPU limit optimisation, Async Apex for long-running operations

Developer Experience10%

Source-driven development (SFDX), scratch orgs, unlocked packages, second-generation packaging, CI/CD pipeline concepts

What Each Section Actually Tests

Design Patterns (25%)

The foundation of PD2. Apex Enterprise Patterns (AEP): Selector layer (all SOQL queries — centralises data access, enforces field-level security checks), Domain layer (business logic tied to an SObject type — validates, defaults, and enriches records), Service layer (orchestrates business processes across multiple objects), Unit of Work (manages all DML in bulk at the end of a transaction to prevent partial commits and governor limit issues). Other patterns: Singleton (prevent duplicate initialisation of expensive objects — e.g., a configuration class loaded once per transaction), Strategy (interchangeable algorithm implementations behind a common interface), Decorator (wrap an existing class to add behaviour). Know how to identify which pattern solves a given architectural problem — the exam presents a scenario and asks which pattern is most appropriate.

Testing and Debugging (25%)

Advanced testing: Test isolation with @TestSetup (runs once, shares data across all test methods), Test.loadData() for CSV-based test data. HTTP callout mocking: HttpCalloutMock interface — implement respond() and register with Test.setMock(HttpCalloutMock.class, mock). Testing async Apex: wrap the enqueue call between Test.startTest() and Test.stopTest()stopTest() forces async execution to run synchronously so you can assert results. Mixed DML errors: cannot insert setup objects (User, Group) and non-setup objects (Account, Contact) in the same transaction — wrap setup DML in a System.runAs() block. Debug log analysis: read EXECUTION_STARTED → SOQL queries (with row counts) → DML statements → EXCEPTION events to diagnose runtime issues.

Integration (23%)

Apex callouts: Http, HttpRequest, HttpResponse for REST; WebServiceCallout.invoke() for SOAP. Cannot make callouts from triggers (they are synchronous DML context) — use a future method or queueable. Named Credentials: store endpoint URL and authentication credentials securely — use callout:NamedCredentialName/path in the endpoint URL. Platform Events: define fields on a Platform Event object, publish with EventBus.publish(), subscribe with triggers or flows. High-volume platform events have at-least-once delivery. Apex REST: expose Apex as a REST API using @RestResource(urlMapping='/v1/myEndpoint/*') and @HttpGet, @HttpPost, etc. annotations.

Performance (17%)

SOQL selectivity: queries are selective when the WHERE clause uses indexed fields (Id, Name, ExternalId, unique fields, or custom indexed fields) and filters enough records (generally <10% of the object's records or <200k records). Non-selective queries on large objects cause timeouts. Query Plan tool: shows whether Salesforce will use an index (low cost) or a full table scan (high cost) for a query. Heap size: 6 MB synchronous / 12 MB async — avoid storing large collections in static variables across transaction boundaries. CPU limit: 10,000 ms synchronous — avoid nested loops over large collections; prefer Maps over repeated list iteration. Async for long-running work: Queueable (chaining, passing complex state), Batch Apex (process millions of records), Scheduled Apex (time-based execution).

Developer Experience (10%)

SFDX / Salesforce CLI: source-driven development using sf project retrieve and sf project deploy. Scratch orgs: temporary, configurable orgs for development and testing — created from a project definition file, last 1–30 days. Unlocked Packages: 2nd-generation packages that are modular, versionable, and source-tracked. Unlike managed packages (ISV), unlocked packages are for org-specific development. Know the difference between 1GP (first-generation, subscriber-opaque), 2GP unlocked (org-internal, source-trackable), and 2GP managed (ISV distribution with namespace). CI/CD: understand the concept of automated pipeline: pull request → scratch org → run tests → deploy to sandbox → promote to production.

8-Week PD2 Study Plan

Week 1–2 — Design Patterns (25%): Study the Apex Enterprise Patterns framework. Read the Force.com Enterprise Architecture book chapters on Selector, Domain, Service, and Unit of Work. Implement the full AEP stack for one object (Opportunity) in a Developer Edition org. Study Singleton, Strategy, and Decorator patterns with Apex code examples.

Week 3–4 — Testing & Debugging (25%): Write tests for HTTP callouts using HttpCalloutMock. Write tests for async Apex (Queueable, Batch) using Test.startTest/stopTest. Practice resolving mixed DML errors. Analyse 3 different debug logs to identify performance bottlenecks and exceptions.

Week 5 — Integration (23%): Build a REST callout to an external API using Named Credentials. Create a Platform Event and subscribe to it with a trigger. Expose an Apex REST endpoint and test it with Workbench. Study streaming API concepts.

Week 6 — Performance (17%): Use the Query Plan tool to analyse 5 different SOQL queries. Refactor a nested loop pattern to use Maps. Write a Batch Apex class that processes 1M records. Profile a Queueable chain using debug logs.

Week 7 — Developer Experience (10%): Create a scratch org from a project definition file. Deploy metadata using SFDX CLI commands. Study unlocked package versioning concepts. Review CI/CD pipeline concepts.

Week 8: Full timed mock exams (60 Q / 120 min). Score 75%+ consistently. PD2 questions often present code snippets — practice reading Apex code quickly and identifying the specific issue.

How to Approach PD2 Scenario Questions

  • Design pattern questions: Questions describe an architectural problem and ask which pattern to apply. Selector = centralise SOQL. Domain = object-level business logic. Service = cross-object process orchestration. Unit of Work = bulk DML. When a scenario says “reduce code duplication in queries across multiple classes,” the answer is Selector. When it says “ensure all DML for a transaction runs together or not at all,” the answer is Unit of Work.
  • Async Apex selection questions: Future method = simple fire-and-forget, no chaining, primitive parameters only. Queueable = complex state (objects as parameters), chainable, one chain at a time. Batch = process large datasets (up to 50M records), configurable batch size. Scheduled = time-based execution. When a scenario needs to process 5M records nightly, the answer is Batch + Scheduled. When it needs to make a callout after a trigger, the answer is Future (or Queueable if state is needed).
  • Performance questions: When a query is timing out on a large object, the first diagnostic step is the Query Plan tool — check if the query is selective. If not selective: add an index to the filter field, or restructure the query to use indexed fields. CPU limit violations: look for nested loops over large collections — refactor to Maps. Heap limit: avoid storing large SObject lists in static variables or Queueable instance variables that persist between chain links.

Mock-Test Benchmark Before Booking

75%+ on 3 timed full mocks (60 Q / 120 min) before booking

PD2 has a higher failure rate than most Salesforce certifications. The most common failure modes are: (1) insufficient hands-on design pattern implementation — studying AEP conceptually is not enough, you must implement it; (2) underestimating the integration section — callout mocking, Named Credentials, and Platform Events require practical experience; (3) skipping the Query Plan tool — performance questions are consistently missed by candidates who have never used it.

Top 10 Topics to Review the Day Before

  1. AEP layers: Selector (SOQL), Domain (business logic), Service (orchestration), Unit of Work (DML)
  2. HttpCalloutMock: implement respond(), register with Test.setMock() in test methods
  3. Testing async Apex: wrap in Test.startTest/stopTest to force synchronous execution
  4. Mixed DML: User + Account in same transaction = error; fix with System.runAs()
  5. Named Credentials: secure endpoint + auth storage; use callout:Name/path in endpoint
  6. Future vs Queueable vs Batch: fire-and-forget vs chainable+complex-state vs large-dataset
  7. Platform Events: publish with EventBus.publish(), subscribe with trigger on EventName__e
  8. SOQL selectivity: use indexed fields in WHERE clause; check with Query Plan tool
  9. Unlocked packages vs managed packages: internal org use vs ISV distribution
  10. Apex REST: @RestResource(urlMapping) + @HttpGet/@HttpPost on global static methods

Practice With Real Exam-Style Questions

Apply this study guide with free PD2 practice questions:

PD1 vs PD2 — how they differ and which to take next →

What Comes After This Certification?

After this certification, consider: Platform Developer II, Platform App Builder, or JavaScript Developer I.

Exam Section Difficulty Heatmap

Which sections are a gimme vs which ones trap confident candidates. Use this to prioritise your final-week revision.

Exam SectionDifficultyStudy Tip
Data ModelingModerateAdvanced data model patterns and large data volume — know governor limits and best practices.
ArchitectureHardDesign patterns, platform limits, and when to use async vs sync — scenario-heavy.
Logic and Process AutomationTrap ⚠Invocable methods, triggers, and queueable — execution order and context are commonly tested.
User InterfaceModerateLWC best practices and accessibility — know when to use @api vs @track.
Testing and DeploymentHardTest design and coverage requirements — meaningful assertions and negative testing.
IntegrationModerateREST, callouts, and platform events — know limits and error handling.

Difficulty based on analysis of common candidate errors across each exam section.

Ready to Test Your Knowledge?

Try the Platform Developer II (PD2) free practice exam — scored with full explanations.

Platform Developer II (PD2) Free Practice Exam →