Courseiva

SF-PD2 · topic practice

Process Automation, Logic, and Integration practice questions

This domain covers Apex asynchronous processing, batch state management, and outbound integrations via HTTP callouts. It tests your ability to design robust, scalable solutions using Batch Apex, Queueable Apex, and callout handling, including error management and logging. Expect scenario-based questions on maintaining state across batches and configuring HTTP requests.

Courseiva uses original exam-style practice questions designed for learning and revision. The goal is to understand the concepts, recognise exam patterns, and improve through explanations — not memorise copied exam dumps.

Editorial oversight:Johnson Ajibi· MSc IT Security, IEEE Senior Member
20 questionsDomain: Process Automation, Logic, and Integration

What the exam tests

What to know about Process Automation, Logic, and Integration

Candidates must be able to implement stateful Batch Apex, configure HTTP callouts with proper headers, and design scalable logging. The most important thing is ensuring asynchronous jobs maintain state correctly and handle callout errors gracefully.

Implementing Database.Stateful in Batch Apex to maintain running totals across batches.

Using HttpRequest.setHeader() to set required Content-Type for external REST services.

Designing efficient logging of outbound API requests with request/response bodies.

Building resilient callouts with retry logic and asynchronous execution using Queueable Apex.

Watch out for

Common Process Automation, Logic, and Integration exam traps

  • ▸Forgetting to implement Database.Stateful when needing to preserve instance variables across batch executions.
  • ▸Omitting the Content-Type header in HttpRequest, causing external service failures.
  • ▸Logging full request/response bodies synchronously in high-volume integrations, hitting governor limits.

Practice set

Process Automation, Logic, and Integration questions

20 questions · select your answer, then reveal the explanation

An enterprise Salesforce org utilizes Platform Events to decouple order processing services. A developer needs to ensure that when a custom Platform Event is published, subscriber processing failures do not cause the publishing transaction to roll back, and subscribers can resume processing from the exact point of failure after a system outage. Which configuration and implementation approach should the developer choose?

Refer to the exhibit. A developer wrote a trigger handler to evaluate child orders when an order's status changes. During stress testing with bulk updates across accounts with numerous child orders, the developer notices intermittent CPU time limit exceptions. What is the root architectural flaw in this Apex code?

Exhibit

public class OrderTriggerHandler {
    public static void handleBeforeUpdate(List<Order> newOrders, Map<Id, Order> oldMap) {
        Set<Id> accountIds = new Set<Id>();
        for(Order ord : newOrders) {
            if(ord.Status != oldMap.get(ord.Id).Status) {
                accountIds.add(ord.AccountId);
            }
        }
        Map<Id, Account> accounts = new Map<Id, Account>([
            SELECT Id, (SELECT Id, Status FROM Orders) FROM Account WHERE Id IN :accountIds
        ]);
        for(Order ord : newOrders) {
            Account acc = accounts.get(ord.AccountId);
            // Complex business logic evaluating child orders
        }
    }
}

An integration architect is designing a bidirectional data synchronization mechanism between Salesforce and an external Enterprise Resource Planning (ERP) system. The solution requires real-time outbound notifications when Account records are modified, ensuring secure transmission and handling potential endpoint unavailability. Which TWO architectural components or patterns should be incorporated? Choose 2 answers.

A developer is writing a bulkified trigger handler for the Account object that performs complex calculations and updates related Contact records. To maintain optimal performance and adhere to Salesforce best practices, which TWO strategies must the developer implement? Choose 2 answers.

A platform developer is designing a custom logging framework that records diagnostic information whenever unhandled exceptions occur in trigger handlers. To ensure that log records are successfully committed to the database even when the main transaction rolls back due to an exception, which feature must be utilized?

Refer to the exhibit. A developer wrote a future method to process orders and make external callouts. During testing with a large data set, the developer notices intermittent failures and performance degradation. What is the primary architectural flaw in this implementation?

Exhibit

public class OrderProcessor {
    @future(callout=true)
    public static void processOrder(Set<Id> orderIds) {
        List<Order__c> orders = [SELECT Id, Status__c FROM Order__c WHERE Id IN :orderIds];
        for(Order__c ord : orders) {
            ord.Status__c = 'Processed';
            Http h = new Http();
            HttpRequest req = new HttpRequest();
            req.setEndpoint('https://api.example.com/orders');
            req.setMethod('POST');
            HttpResponse res = h.send(req);
        }
        update orders;
    }
}

An architect is designing an integration where an external system must update a custom object in Salesforce. The external system is restricted to standard REST APIs and cannot handle OAuth refresh tokens. Which authentication approach should the architect recommend to ensure both security and operational reliability?

Refer to the exhibit. An integration is failing when updating records because the process triggers a cascade of updates that hits the platform's recursion limit. Which strategy should the developer implement to safely handle this scenario while ensuring all required updates are applied?

Exhibit

{
  "status": "error",
  "message": "Maximum stack depth reached",
  "code": 101
}

An organization is migrating legacy data and needs to ensure that validation rules are respected while improving performance during bulk inserts. Which THREE strategies are effective for balancing data integrity and system throughput?

A developer needs to dynamically query objects and fields based on user input for a custom reporting tool. Which Apex feature allows the developer to construct and execute these queries safely while preventing SOQL injection?

An integration developer is tasked with syncing data between two Salesforce orgs. Which THREE considerations are critical to ensure data consistency and system reliability?

A developer needs to ensure that an Apex class runs with the permissions of the user who invokes it, rather than system-wide permissions. Which keyword should be added to the class definition?

A developer is building an Apex REST service exposed at /services/apexrest/orders/. The service must accept a JSON payload and reject requests whose body cannot be deserialized into the OrderRequest wrapper class, returning HTTP 400 without leaking internal exception details. Which implementation satisfies this requirement?

A developer needs an Apex callout to an external inventory service to be retried automatically up to three times when the service returns HTTP 503, with short waits between attempts, and the final failure must be logged. Which approach correctly implements this within a single Apex transaction?

A developer is building an Apex class that must be callable from a Lightning web component and also from an external system via REST. The class performs DML on a custom object and must enforce the running user's field-level security and object permissions. The developer annotates the class with `with sharing` and declares the method as `public static`. During testing, an external integration user with limited permissions receives a `System.DmlException` for insufficient access, but the developer expected the operation to succeed because the integration user has create permission on the object. What is the most likely cause?

A developer writes a Queueable Apex class that performs a callout to an external payment gateway and then updates a custom object. The class is enqueued from a trigger. During testing in a sandbox, the callout succeeds but the subsequent DML fails with a 'You have uncommitted work pending' error. What is the most likely cause?

A developer is building a Flow that must call an external REST API to retrieve a customer's credit score and then update the Contact record with the result. The external API occasionally takes up to 30 seconds to respond. The Flow is triggered from a Lightning Web Component and must not block the user interface. Which approach should the developer use to call the external API from the Flow?

A developer is building a Lightning web component that calls an Apex method to retrieve a list of contacts. The method performs a SOQL query and returns the results. During testing, the component fails with an 'AuraHandledException' error. What is the most likely cause?

A developer is implementing a Queueable Apex job that makes a callout to an external REST API after performing DML to create an Order. The job is enqueued from a Visualforce controller action. During testing, the callout fails with a 'You have uncommitted work pending' error. What is the most likely cause and the correct resolution?

A developer has written a Queueable Apex class that performs a callout to an external system and then updates a custom object. The class implements Database.AllowsCallouts. During testing, the developer notices that the callout is not being made when the job is executed. What is the most likely cause?

Free account

Track your progress over time

Create a free account to save your results and see which topics improve across sessions.

Focused Process Automation, Logic, and Integration sessions

Start a Process Automation, Logic, and Integration only practice session

Every question in these sessions is drawn from the Process Automation, Logic, and Integration domain — nothing else.

Related practice questions

Related SF-PD2 topic practice pages

Move into related areas when this topic feels solid.

Frequently asked questions

What does the SF-PD2 exam test about Process Automation, Logic, and Integration?
Candidates must be able to implement stateful Batch Apex, configure HTTP callouts with proper headers, and design scalable logging. The most important thing is ensuring asynchronous jobs maintain state correctly and handle callout errors gracefully.
How should I use these practice questions?
Select your answer before revealing the explanation. Then read why each option is right or wrong — this active recall approach builds retention far faster than re-reading notes.
Can I practise just Process Automation, Logic, and Integration questions in a focused session?
Yes — the session launcher on this page draws every question from the Process Automation, Logic, and Integration domain. Use a 10-question session first to gauge your baseline, then move to 20 or 30 once the weak spots are clear.
Where can I practise other SF-PD2 topics?
Use the topic links above to move to related areas, or go back to the SF-PD2 question bank to see all topics.
Are these real exam questions or dumps?
These are original practice questions written to test the same concepts the SF-PD2 exam covers. They are not copied from any real exam or dump site.