Be able to select the right platform feature for a stated requirement and spot the single most critical flaw in a code exhibit. The most important thing: recognize when code must be bulkified, keeping SOQL and DML out of loops and using collections, Batch Apex, or Queueable as appropriate.
Start practicing
Advanced Developer Fundamentals — choose a session length
Free · No account required
Domain overview
This domain covers the core Apex and platform mechanics a Salesforce developer must command: secure callouts, custom settings, bulk-safe data processing, and defensive coding. Questions are scenario-based, presenting code exhibits or stated requirements and asking you to identify the correct feature, the primary benefit, or the most critical fix.
Exam objectives
Named Credentials for callout endpoints and authentication, versus hardcoded URLs and stored secrets
Hierarchy custom settings for profile- or user-scoped data accessible without SOQL
Bulkified Apex patterns such as Batch Apex and collections to stay within governor limits
Defensive coding: null checks, exception handling, and query and DML placement outside loops
Assuming list custom settings can vary per user; only hierarchy custom settings support profile or user-level values without SOQL.
Confusing Named Credentials with Remote Site Settings; Named Credentials handle authentication and endpoint, Remote Site Settings only allowlist URLs.
Placing SOQL or DML inside loops, which breaks bulk processing and triggers governor limit exceptions on large data volumes.
Click any question to see the full explanation and answer options, or start a focused practice session above.
When 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?
2A developer needs to dynamically instantiate a class at runtime based on a string value. Which feature should they use?
3A 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?
4A 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?
5Refer to the exhibit. The developer observes the error above. What is the most efficient architectural change to prevent this limit from being hit?
6Refer 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?
7A developer is using the 'System.runAs()' method in a test class. What is the effect of this method on the test execution?
8Refer 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?
9A 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?
10A developer needs to prevent a recursive trigger execution when updating parent records. What is the most robust way to handle this in Apex?
11A 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?
12Refer 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?
13A 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?
14A 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?
15A 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?
16A 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?
17A 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.)
18A 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?
19A 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?
20A 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?
21A 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?
22A 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?
23A 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?
24A 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?
25A 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?
26A 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?
27A 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?
28A 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?
29A 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?
30A 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?
31A 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?
32A 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?
33A 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?
34A 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?
35A 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?
36A 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?
37A 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.)
38A 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?
39A 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.)
40A 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?
Be able to select the right platform feature for a stated requirement and spot the single most critical flaw in a code exhibit. The most important thing: recognize when code must be bulkified, keeping SOQL and DML out of loops and using collections, Batch Apex, or Queueable as appropriate.
The Courseiva SF-PD2 question bank contains 40 questions in the Advanced Developer Fundamentals domain. Click any question to see the full explanation and answer breakdown.
Start with a 10-question focused session to identify your baseline accuracy in this domain. Read every explanation — even for questions you answer correctly — to understand the reasoning. Once you score consistently above 80%, move to a 20–30 question session to confirm depth before moving to the next domain.
Yes — the session launcher on this page draws questions exclusively from the Advanced Developer Fundamentals domain. Choose 10, 20, 30, or 50 questions for a focused session, or click individual questions to review them one by one.
Save your results, see per-domain analytics, and get readiness scores — free, for every certification.
Sign Up FreeFree forever · Every certification included