Sample questions
Salesforce Certified Platform Developer II practice questions
Refer to the exhibit. A developer is reviewing a debug log for a failed transaction. What is the primary performance issue identified in the log snippet?
A developer is writing an Apex trigger that should only fire when specific fields are changed. Which THREE practices help optimize the trigger's performance?
Refer to the exhibit. What is the primary security advantage of using a 'Named Credential' in this callout as opposed to hardcoding the API endpoint and credentials?
A developer wants to inspect private variable states and trace execution paths of a complex trigger framework during a sandbox debugging session. Which tool should the developer us…
What is the best way to test asynchronous Apex (Future methods, Queueable) to ensure the logic within the background job actually executes?
A developer is writing a test class that requires a user with a specific profile. How should the developer handle the user creation process?
A developer is preparing for a deployment using Salesforce DX. Which TWO practices are recommended to ensure successful and repeatable deployments?
A developer wants to create a custom setting that can be accessed globally within Apex code without performing a SOQL query. Which type of custom setting is most appropriate if the…
A developer is building a complex nested Lightning Web Component structure. A deeply nested child component needs to notify an ancestor component, which is not the immediate parent…
A developer is building a Lightning Web Component that needs to communicate with a parent component in a deep containment hierarchy. The event must traverse shadow boundaries witho…
A developer is writing a complex asynchronous batch Apex job that processes millions of financial transaction records. The job needs to maintain running totals across batches and u…
Process Automation, Logic, and IntegrationhardSee the answer and why each option is right or wrong →Refer to the exhibit. The Apex transaction is consistently hitting the CPU limit. What is the most likely cause and the best way to optimize the code?
An enterprise Salesforce application requires high-performance execution of complex SOQL queries across millions of records. Which strategy should a developer implement to ensure o…
A developer is attempting to debug a failed deployment in a sandbox. The error message is cryptic, and the debug logs are not capturing the expected execution flow. What should the…
A developer wants to minimize the impact of long-running operations on the user interface. Which design pattern should they utilize?
Refer to the exhibit. The service is failing because the external system requires a specific 'Content-Type' header that is missing. Which addition to the code will correctly resolv…
Process Automation, Logic, and IntegrationmediumSee the answer and why each option is right or wrong →A developer is writing a query to fetch related records. Which SOQL pattern is best for avoiding unnecessary query execution and improving performance?
A company requires that an integration log all outbound API requests for auditing purposes, including the full request and response body. Given the potential for high volumes, whic…
Process Automation, Logic, and IntegrationhardSee the answer and why each option is right or wrong →An enterprise development team uses Salesforce DX scratch orgs for feature development. A developer needs to ensure that unit tests execute automatically every time code is committ…
A developer is building a Lightning Web Component for a Lightning Experience app. The component contains a form with an <input> for a search term and a list of results. When the us…
A developer needs to debug an Apex trigger that intermittently fails in production with a 'UNABLE_TO_LOCK_ROW' error when multiple users update related records. Which technique sho…
A developer is building a Lightning Web Component that needs to display a formatted date and time based on the user's timezone. Which standard JavaScript object, compatible with LW…
A developer is building a Lightning Web Component that must call an Apex method that performs a callout. The component is placed on a Lightning record page, and the Apex method is…
An enterprise application requires integrating an external REST API that frequently times out. A developer needs to implement a robust outbound callout mechanism in Apex that handl…
Process Automation, Logic, and IntegrationmediumSee the answer and why each option is right or wrong →