Platform Developer II Free Sample Questions

Salesforce Certified Platform Developer II Practice Test
10/251 questions · Unlock full access
Q1

A financial services company uses a custom Apex REST service to receive transaction data from a third-party system. The service must process batches of up to 200 transactions, create corresponding custom `Transaction__c` records, and update the related `Account`. If any transaction in the batch is invalid, the entire operation must be rolled back, and a specific error message must be returned. Which Apex feature is most appropriate for maintaining transactional integrity in this scenario?

Q2

A developer is building a Lightning Web Component to display a list of related `Case` records on an `Account` page. The component must be reusable and configurable by an administrator, allowing them to specify the `Status` and `Priority` to filter the cases shown. How should the developer implement this configurability for the Lightning App Builder?

Q3

Universal Containers needs to synchronize large volumes of `Product__c` records (potentially over 1 million) nightly from an external Product Information Management (PIM) system. The process involves complex transformations and enrichment logic that cannot be handled by middleware. A developer has decided to implement this using Batch Apex. To optimize performance and avoid governor limit issues, what is the best approach for the `start` method to query the records to be processed?

Q4Multiple answers

A developer needs to write a unit test for a method that makes an HTTP callout to an external weather service. The test must verify the logic that parses the JSON response and updates a `Forecast__c` record. Which two approaches are necessary to ensure the test runs successfully without making a real callout and properly isolates the test data? (Select TWO)

Q5

A Visualforce page uses a custom controller to display a data table of `Opportunity` records. The controller uses a large, complex SOQL query to gather the data. Users report that the page sometimes throws a 'Maximum view state size limit exceeded' error, especially when filtering results that return many rows. Which modification is the most effective way to mitigate this specific error?

Q6

Quantum Logistics has a complex, multi-lingual Salesforce org. They need to store configuration data for a custom shipping calculator, including shipping rates, service levels, and country-specific surcharges. This configuration data must be deployable between sandboxes and production, and it needs to be easily queryable within Apex. The data structure is relational, with 'Service Levels' being a parent to 'Country Surcharges'. What is the most appropriate solution for storing this configuration data?

Q7

A developer at a large enterprise is tasked with creating a nightly batch job that deactivates `Contact` records that have not been logged into a community for over 180 days. The org contains over 10 million `Contact` records. The initial SOQL query `SELECT Id FROM Contact WHERE LastLoginDate < LAST_N_DAYS:180` is timing out. What is the most effective way to resolve this query performance issue?

Q8

True or False: When using the `Database.upsert` method with an External ID field, if multiple records in the database match the provided External ID, the operation will throw a DML exception.

Q9

A developer needs to expose an Apex method that can be called from a Process Builder or Flow. The method should accept a list of `Opportunity` IDs and perform a complex calculation that is not possible with declarative tools. Which annotation must be used for the Apex method?

Q10

A business process requires that when an Opportunity is updated, a callout is made to an external system to reserve inventory. This callout must not delay the saving of the Opportunity record. If the callout fails, it should be automatically retried up to three times. Which asynchronous Apex pattern best meets all these requirements?