Free Platform Developer II sample questions
Real questions from the Salesforce Certified Platform Developer II practice bank, with the correct answer and an explanation for each one. No junk, no filler.
Try them in the simulator Same questions, with study, timed and flashcard modes.
Showing 10 of 20 free sample questions.
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)
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?
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?
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?
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.
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?
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?
A developer has an Apex trigger on the `Account` object. This trigger calls a helper method that updates all related `Contact` records. The same helper method is also called from a Visualforce controller. To prevent the trigger from executing recursively when the contacts are updated, what is the recommended best practice?
A custom Visualforce page is used to create and edit `Project__c` records. To support international users, all labels and messages on the page must be translated. How should a developer ensure that text displayed on the page is translatable?
10 more free samples are waiting
Create a free account to unlock the whole Platform Developer II sample bank, or get full access to all 251 practice questions in the simulator.