SALESFORCE-PLATFORM-DEVELOPER-II · domain
Advanced Developer Fundamentals
Practise Salesforce Certified Platform Developer II Advanced Developer Fundamentals practice questions — original exam-style scenarios with answer choices, explanations, and analysis of common mistakes.
Focused practice
Practice Advanced Developer Fundamentals questions
Scored sessions drawing only from this domain — pick a length below.
Start 20-question practice test →What this domain covers
What to know about Advanced Developer Fundamentals
Advanced Developer Fundamentals questions test whether you can apply the concept in context, not just recognise a definition.
How the topic appears in realistic exam-style scenarios.
Which detail in the question changes the correct answer.
How to eliminate plausible but wrong options.
How to connect the question back to the wider exam objective.
Watch out for
Common Advanced Developer Fundamentals exam traps
- ▸Answering from memory before reading the full scenario.
- ▸Missing a constraint such as cost, availability, security, scope or command context.
- ▸Choosing a broad answer when the question asks for the most specific fix.
- ▸Ignoring why the wrong options are tempting.
Question index
All Advanced Developer Fundamentals questions (40)
Click any question to see the full explanation, or start a practice session above.
A developer is building an Apex REST resource that must return a list of Accounts in JSON format. The resource class is defined with @RestResource(urlMapping='/Accounts/*'). The developer wants to ensure that the response includes only the Account Name and Id fields, and that the JSON structure is flat (no nested attributes). Which approach should the developer use?
Medium2A developer is writing a test method for a class that performs a SOQL query on a custom object. The test must ensure that the query returns the expected number of records. Which testing approach should be used to create test data that is isolated from the organization's data?
Medium3Refer to the exhibit. The developer observes the error above. What is the most efficient architectural change to prevent this limit from being hit?
Medium4A developer is building an Apex REST resource that must accept an inbound JSON payload from a third-party system. The payload contains a nested structure with a list of order line items, each having its own nested product object. The developer wants to deserialize the payload directly into typed Apex classes without writing manual parsing logic. Which approach should the developer use?
Medium5A developer needs to write an Apex test method that verifies a trigger correctly updates a related Contact when an Account is inserted. The trigger performs a SOQL query and a DML update. What must the developer do to ensure the test passes in a Salesforce sandbox?
Easy6A developer needs to implement a custom validation rule that involves complex cross-object logic. The logic is too complex for a standard Validation Rule formula. What is the best practice for implementing this logic?
Medium7A developer is building a Lightning web component that needs to display a list of Accounts with their Contacts. The component should allow users to select an Account and see its Contacts without a full page reload. Which Apex feature should be used to retrieve the Contacts when an Account is selected?
Hard8A developer is building a lightning component that needs to communicate with an external API. What is the recommended way to handle the secure storage of API credentials?
Medium9A developer needs to enforce that a custom object's field is required only when another field has a specific value. The validation must apply to all data entry points, including API and Apex. Which feature should be used?
Medium10A developer needs to add a custom field to the Account object that stores a numeric risk score. The field must be available to Apex code, Flow, and the REST API, and must not be exposed on any page layout. Which metadata type and deployment approach should the developer use?
Easy11A developer is using the 'System.runAs()' method in a test class. What is the effect of this method on the test execution?
Hard12Refer to the exhibit. The developer has implemented the security check inside the 'process' method. Why is this implementation insufficient for a secure, professional-grade enterprise application?
Hard13A developer needs to execute a large number of updates to records that might trigger complex process automation. Which approach minimizes the risk of hitting governor limits?
Medium14A developer is designing a custom exception handling framework for an Apex class that processes large data sets. The framework must log exceptions to a custom object and ensure that the original transaction is not rolled back due to the logging operation. Which two techniques should the developer use to achieve this? (Choose two.)
Hard15A developer is implementing a custom Apex class that uses the Queueable interface to process a large number of records asynchronously. The class must be able to chain another job if there are more records to process. Which method should the developer use to enqueue the next job?
Hard16A developer needs to dynamically instantiate a class at runtime based on a string value. Which feature should they use?
Easy17A developer needs to prevent a recursive trigger execution when updating parent records. What is the most robust way to handle this in Apex?
Medium18Refer 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?
Hard19A developer needs a Visualforce page to display account data and also expose a REST endpoint that returns the same data to an external system. The developer wants to reuse the query and business logic. Which approach best satisfies this requirement?
Medium20A developer needs a custom Apex controller method to return a filtered list of Opportunities for a Visualforce page. The method must respect the running user's record-level access so that users cannot see Opportunities they are not permitted to view. Which approach should the developer use?
Hard21When designing a unit test for a class that makes callouts, which pattern is the industry standard for ensuring the test does not actually send requests?
Medium22A developer needs to write a unit test for an Apex class that performs a callout to an external REST endpoint. The test must not make a real HTTP request and must simulate a successful response with a specific status code and body. Which approach should the developer use?
Easy23A developer is building an Apex REST service that must accept an inbound JSON payload from an external system. The external system sends an array of order records, and the developer needs the JSON keys (such as order_id) to map directly to Apex property names (such as order_id) without any manual transformation. Which approach should the developer use to deserialize the payload into Apex objects?
Medium24A developer has written an Apex class that queries for a large number of records and processes them in a loop. The developer notices that the transaction is hitting the heap size limit. Which technique should be used to process the records in smaller batches to avoid exceeding the limit?
Easy25A developer is building an Apex batch class that processes 2 million Account records. The start method returns a QueryLocator for all Accounts, but the batch job fails during execution with a 'First error: Apex CPU time limit exceeded' message. The execute method performs several SOQL queries inside a loop over the batch scope records. Which approach should the developer use to resolve the CPU time limit issue while keeping the batch design intact?
Medium26A developer needs to expose an Apex method so that a Lightning web component can call it and receive a list of Account records. The method must be static and the component uses the wire service to invoke it. Which annotation combination should the developer apply to the Apex method?
Medium27A developer is designing an Apex class that must support dependency injection so that unit tests can substitute a fake implementation of a service interface. The production code should use the real service, while tests inject a stub. Which two techniques should the developer use to achieve this? (Choose two.)
Medium28A developer needs to write a test method for an Apex class that performs a callout to an external web service. The test must not make an actual callout and should simulate a successful response. Which approach should be used?
Medium29A developer must write a test class for an Apex service that performs an HTTP callout to an external REST API. The test cannot make real callouts. Which approach should be used to simulate the callout response?
Medium30A developer is building a service class that must call an external REST endpoint and then update a related record. The external callout occasionally exceeds the allowed response time. The developer wants the update to occur only when the callout succeeds, and wants the failure path to be handled cleanly without leaving partial state. Which approach best satisfies these requirements?
Hard31A 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 data varies per user profile?
Medium32A developer is writing a unit test for an Apex service class that calls an external REST endpoint using HttpRequest and Http. The test needs to verify that the class correctly parses a successful JSON response and also handles a 500 error response. The class uses a named credential for authentication. Which approach should the developer use to test both scenarios without making real callouts?
Hard33A developer is writing a unit test for a service class that performs a callout to an external REST endpoint. The test needs to verify that the class correctly parses a JSON response and updates a record. Which approach should the developer take to simulate the callout response in the test?
Medium34A developer is writing Apex tests for a service class that processes a collection of Account records. The test method must verify that the class correctly handles governor limits by checking how many SOQL queries were used. Which method should the developer call to obtain this information?
Medium35A developer is building an Apex class that must process records in batches and allow partial success, so that records failing validation are skipped while the rest commit. During testing, the developer notices that Database.insert(records, false) still throws a DmlException for a required-field violation instead of populating a SaveResult. What is the most likely cause?
Medium36Refer to the exhibit. The developer needs to update this code to be more robust. What is the most critical issue to address in this code snippet?
Medium37A developer is tasked with handling a large volume of external data updates in Salesforce. To ensure optimal performance and avoid governor limit issues, which bulk processing approach should be used?
Medium38A developer is building a custom REST API using Apex. The API must return a response with a specific HTTP status code and a JSON body that includes custom error details. Which approach should be used to construct the response?
Hard39A developer is designing a Queueable Apex job that must process a large set of records and then enqueue additional work. The developer wants the job to be robust and to observe platform limits. Which two statements about Queueable Apex are correct? (Choose two.)
Medium40A developer needs to write an Apex trigger that updates a field on an Opportunity when a related OpportunityLineItem is inserted. The developer wants to ensure the trigger handles bulk operations efficiently. Which trigger event should be used?
EasyFrequently asked questions
- What does the Advanced Developer Fundamentals domain cover on the SALESFORCE-PLATFORM-DEVELOPER-II exam?
- Advanced Developer Fundamentals questions test whether you can apply the concept in context, not just recognise a definition.
- How many questions are in this domain?
- This page lists all 40 Advanced Developer Fundamentals questions in the SALESFORCE-PLATFORM-DEVELOPER-II question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
- What is the best way to practise this domain?
- Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
- Can I practise only Advanced Developer Fundamentals questions?
- Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.