Salesforce Developer Interview Guide
Salesforce Developer Interview Guide
Introduction (3 minutes)
• Interviewer: "Welcome! Please introduce yourself and briefly describe
your Salesforce development experience."
• Candidate: (Shares background, projects, skills)
Integration (5 minutes)
• Interviewer: "What are Named Credentials, and why are they important?"
• Candidate: (Used to simplify authentication and secure API calls)
• Interviewer: "Describe a Salesforce integration you worked on and key
challenges."
• Candidate: (Shares example, handling data sync, error handling, secure
callouts)
Automation (5 minutes)
• Interviewer: "What are the differences between Workflow Rules, Process
Builder, and Flow?"
• Candidate: (Describes features, limitations, when to use each)
• Interviewer: "How do you handle error handling and governor limits in
Flows?"
• Candidate: (Fault paths, bulkification considerations)
VI. Automation: Declarative tools such as Flows, Process Builder, Workflow Rules.
VII. Testing & Deployment: Apex test classes, Salesforce DX, sandboxes, change sets,
deployment best practices.
III. Data Management: Data import/export tools (Data Loader, Data Import Wizard),
data validation rules, duplicate management.
IV. Salesforce Setup & Configuration: Custom objects, fields, page layouts, record
types, and apps.
VI. Reports & Dashboards: Creating and optimizing custom reports, dashboards, and
analytic snapshots.
Apex Programming
1. How do you ensure your Apex code is bulkified, and why is it important?
2. Explain the differences and use cases of Lightning Web Components
(LWC) versus Aura components.
3. Describe a complex integration you have implemented using Salesforce
APIs. What challenges did you face?
4. How do you handle governor limits in Salesforce, and what techniques do
you use to avoid hitting them?
5. What is your approach to writing Apex test classes? How do you ensure
high code coverage and quality?
6. Explain the Salesforce security model, including roles, profiles,
permission sets, and sharing rules.
7. When would you choose Flow or Process Builder over Apex for
automation? Provide an example.
8. Describe how you manage deployments and version control in your
Salesforce projects.
9. Can you share a scenario where you debugged a difficult issue in
Salesforce? What steps did you follow?
10. How do you optimize SOQL queries for performance in your Apex
code?
SOQL Questions
1. What is SOQL, and how is it different from traditional SQL?
2. How do you query parent-to-child and child-to-parent relationships using
SOQL?
3. How do you use the LIMIT clause in SOQL? Give an example.
4. What is the difference between Static and Dynamic SOQL, and when
would you use each?
5. How do you query deleted records in Salesforce with SOQL?
6. Explain how you would optimize SOQL queries to avoid hitting governor
limits.
7. How can you filter records using the WHERE clause in SOQL?
SOSL Questions
8. What is SOSL, and how is it different from SOQL?
9. When would you use SOSL instead of SOQL? Provide scenarios.
10. How do you write an SOSL query to search across multiple objects?
Security Questions
7. How does Salesforce’s role hierarchy affect record-level access?
8. What is the difference between profiles and permission sets?
9. Explain the organization-wide default (OWD) sharing model and how it
can be customized.
10. How do you enforce field-level security in Salesforce?
Integration
1. What are the different types of Salesforce integrations?
2. How do REST API and SOAP API differ in Salesforce, and when would you
use each?
3. What are Named Credentials, and why are they important in integrations?
4. Explain the difference between Outbound Messaging and Apex Callouts.
5. Describe how you authenticate an external system with Salesforce.
6. How do you handle large data volumes in Salesforce integrations?
7. What is middleware, and what role does it play in Salesforce integrations?
8. How do you ensure data consistency between Salesforce and an external
system?
9. How do you troubleshoot and debug Salesforce integration issues?
10. Explain the use of Platform Events in Salesforce integrations.
Automation
1. What are the differences between Workflow Rules, Process Builder, and
Flow in Salesforce automation?
2. When would you choose to use Flow over Process Builder or Apex
triggers?
3. How do you handle error handling and fault paths in Salesforce Flows?
4. Describe a complex automation project you worked on and the challenges
you faced.
5. How do you optimize Flows to handle large data volumes and avoid
governor limits?
6. What is an invocable Apex method, and how is it used in Flow?
7. How would you design a Flow to update related records automatically?
8. How can you schedule a Flow to run at specific times or intervals?
9. Explain the difference between Record-Triggered Flows and Schedule-
Triggered Flows.
10. How do you ensure user adoption and usability in screen Flows?
1. What is the purpose of Apex test classes, and what are the key requirements for
writing them?
2. How do you achieve code coverage in Apex, and what is the minimum coverage
required for deployment?
4. What are [Link]() and [Link]() methods used for in test classes?
6. What is Salesforce DX, and how does it improve the development and deployment
process?
7. Can you explain the different types of sandboxes in Salesforce and their use cases?
8. How do change sets work in Salesforce, and what are their limitations?
performance
1. What are Salesforce governor limits, and why are they important in Apex
development?
2. Can you explain common governor limits related to SOQL queries and DML
operations?
3. How do you avoid hitting the "Too many SOQL queries: 101" governor limit in Apex
triggers?
5. Describe how you optimize Apex code to stay within CPU time limits.
6. How do you handle large data volumes in Salesforce while respecting governor
limits?
7. What best practices do you follow when writing triggers to prevent recursive calls
and hitting limits?
9. How do you monitor and debug governor limit issues during development?
10. What techniques do you use to optimize SOQL queries for performance?
Change Management
1. What are the different types of Salesforce sandboxes, and when would you use each
type in a release cycle?
3. Can you explain the purpose of change sets and what their limitations are in
deployment?
4. Describe best practices for managing metadata and configuration changes across
multiple sandboxes before deploying to production.
5. How do you handle post-refresh tasks in sandboxes, such as masking sensitive data
or updating endpoints?
Bulkification refers to designing Apex code to process multiple records simultaneously, rather than one at
a time. It’s important because Salesforce imposes governor limits to ensure resource sharing in the multi-
tenant environment. Bulkified code reduces the number of SOQL queries and DML operations, avoiding
hitting limits and improving performance.
To bulkify, use collections like Lists, Sets, or Maps to handle multiple records. Move SOQL queries and
DML statements outside of loops. For example, rather than querying inside a loop for each record, collect
record IDs first and run a single query for all related records. Similarly, accumulate records to update in a
list, then perform one bulk DML operation.
2. Explain the differences and use cases of Lightning Web Components (LWC) versus Aura
components.
LWCs are built on modern web standards and optimized for better performance and faster rendering
than Aura components. They use standard JavaScript, making them easier to learn and maintain. Aura
components provide a more mature framework with a wider range of base components but can be slower
and more complex.
Use LWC for new development, especially when performance, modern browser support, and
maintainability are priorities. Aura components are useful when working with legacy code or when LWC
features don’t yet cover specific use cases.
3. Describe a complex integration you have implemented using Salesforce APIs. What challenges
did you face?
I worked on integrating Salesforce with an external ERP system using REST APIs. Key challenges included
handling authentication securely, managing large data volumes without hitting governor limits, and
ensuring data consistency during sync processes. We used Named Credentials for secure authentication
and implemented batch processing and retry logic to handle failures. Mapping data fields and handling
different data models across systems also required careful transformation logic.
4. How do you handle governor limits in Salesforce, and what techniques do you use to avoid
hitting them?
I always design Apex to be bulkified, avoiding SOQL and DML inside loops. I leverage collections for
efficient data processing and use asynchronous Apex (Batch, Queueable) when processing large data sets.
I optimize SOQL queries by filtering records and retrieving only necessary fields. I monitor debug logs
and use limits methods to proactively check consumption. When limits are close, I refactor code to reduce
queries and DML or split processing into batches.
5. What is your approach to writing Apex test classes? How do you ensure high code coverage and
quality?
I write test classes that cover positive, negative, and boundary cases, ensuring over 75% code coverage. I
create necessary test data within the test methods using static resources or setup logic. I use
[Link]() and [Link]() to simulate governor limits and asynchronous processing. I assert
expected outcomes explicitly to catch failures early. I also follow best practices like using
SeeAllData=false and avoiding dependencies on org data.
6. Explain the Salesforce security model, including roles, profiles, permission sets, and sharing
rules.
Profiles define base user permissions and object-level access. Permission sets extend these permissions
without changing profiles, allowing more granular control. Roles define record-level sharing based on an
organization's hierarchy, controlling visibility of records. Sharing rules further open access by defining
exceptions to the default sharing model (OWD). Layering these elements enables flexible, secure access
tailored to business needs.
7. When would you choose Flow or Process Builder over Apex for automation? Provide an
example.
Flow and Process Builder are declarative tools ideal for simple to moderately complex automations
without code. Use Flow or Process Builder when requirements involve simple record creation, updates, or
sending notifications.
For example, a Process Builder can update a related record when an opportunity stage changes. If the
automation requires complex logic, loops, or integrations, Apex is more appropriate.
8. Describe how you manage deployments and version control in your Salesforce projects.
I use Salesforce DX and Git for source-driven development. Developers work in scratch orgs or sandboxes,
committing changes to Git repositories. CI/CD tools automate validation, testing, and deployment. Change
sets are used for smaller teams or quick deployments but are limited in automation. I ensure proper
branching strategies and code reviews to maintain code quality and coordination.
9. Can you share a scenario where you debugged a difficult issue in Salesforce? What steps did you
follow?
Once, a trigger was causing unexpected record updates leading to data inconsistencies. I enabled debug
logs for the user, analyzed log outputs to trace the execution flow, and identified SOQL queries inside
loops causing repeated unintended updates. I refactored the trigger by bulkifying code and adding flags to
prevent recursion, resolving the issue.
10. How do you optimize SOQL queries for performance in your Apex code?
I select only the fields necessary instead of ‘SELECT *’. I use selective filters and indexed fields in WHERE
clauses to reduce returned rows. I avoid nested queries unless necessary and use relationship queries
efficiently. When querying large data sets, I implement pagination or batch processing. I also use Query
Plan Tool to analyze and improve query performance.
1. What are the key differences between Lightning Web Components (LWC) and Aura
Components?
LWC uses modern web standards (HTML, ES6+ JavaScript), offers faster performance, simpler syntax, and
better maintainability. Aura is an older framework with its own event system and heavier rendering
overhead, mainly used for legacy apps. LWC is recommended for new development.
2. Explain the lifecycle hooks in LWC and their typical use cases.
• connectedCallback(): Called when the component is inserted into the DOM; used for fetching data
or setup.
3. How do you handle communication between parent and child components in LWC?
The parent uses the @api decorator to expose properties/methods that the child can access. The child
notifies parent components by dispatching custom events which the parent listens to.
4. What are the different ways to communicate between two sibling Lightning Web Components?
Use a common parent component to mediate communication by event dispatching or leverage pub/sub
patterns with an event bus module to communicate without direct hierarchy.
Import Apex methods using @salesforce/apex and then call them imperatively using promises or wire
adapters for reactive data.
Example:
js
import getAccounts from '@salesforce/apex/[Link]';
getAccounts()
Use JavaScript promises with .then() and .catch() for async Apex calls or async/await syntax for better
readability. Handle errors gracefully and update the component state after promise resolution.
Use reactive properties marked with @track (deprecated in latest LWC) or simply class fields for
primitive values. State changes trigger rerendering.
8. What are the security considerations when developing LWCs, especially regarding data access
and DOM manipulation?
Prevent Cross-Site Scripting (XSS) by sanitizing user inputs. Use Lightning Data Service or Apex to enforce
CRUD/FLS checks. Avoid direct DOM manipulation outside safe methods and leverage Locker Service
protections.
9. How do you handle component styling and CSS encapsulation in Lightning Web Components?
LWC uses Shadow DOM to encapsulate styles, preventing leakage. Styles are scoped to components. Use
static css files with components and leverage Lightning Design System (SLDS) classes for consistent
styling.
10. Describe an optimization technique you have used to improve the performance of Lightning
Web Components.
Implemented lazy loading for data-heavy components, debounced input handlers to reduce unnecessary
processing, and minimized the number of reactive properties to reduce rerender cycles, improving UI
responsiveness and load times.
4. What is the difference between Static and Dynamic SOQL, and when would you use each?
• Static SOQL: Query is hardcoded in Apex, safer and easier to maintain. Used when query is known
at compile time.
• Dynamic SOQL: Query is constructed as a string at runtime, useful for flexible or conditional
querying.
6. Explain how you would optimize SOQL queries to avoid hitting governor limits.
Select only necessary fields, use selective filters on indexed fields, avoid queries inside loops, use
relationship queries efficiently, and leverage query pagination for large datasets.
7. How can you filter records using the WHERE clause in SOQL?
Use the WHERE clause with field operators (=, !=, <, >, IN, LIKE, etc.) to filter records based on
conditions, e.g.:
SELECT Name FROM Contact WHERE Email LIKE '%@[Link]'
SOSL Questions
10. How do you write an SOSL query to search across multiple objects?
Example:
FIND {John} IN ALL FIELDS RETURNING Contact(Id, Name), Account(Id, Name)
Answers for Data Model and Security interview questions
1. What are the main types of relationships in Salesforce? Explain Master-Detail and Lookup
relationships.
Master-Detail is a tight relationship where the child record’s existence depends on the parent;
deleting the parent deletes the child, and security is inherited. Lookup is a loose relationship
allowing independent record existence; deleting the parent does not delete the child unless
configured.
6. What are External IDs, and how are they useful in data integration?
External IDs are custom fields marked to hold unique identifiers from external systems, facilitating
upsert operations and matching records during integration without relying on Salesforce record
IDs.
Security Questions
9. Explain the organization-wide default (OWD) sharing model and how it can be customized.
OWD sets the default record access level (private, public read, or read/write). Custom sharing
rules and role hierarchy can extend access beyond OWD defaults.
10. How do you enforce field-level security in Salesforce?
Field-level security is enforced via profiles or permission sets by specifying field read/write
permissions, ensuring sensitive data is accessible only to authorized users.
Integration Questions
2. How do REST API and SOAP API differ in Salesforce, and when would you use each?
REST API is lightweight, uses JSON, and is easier for web/mobile integration. SOAP API is protocol-
heavy, XML-based, suited for enterprise-level, formal contracts, and operations requiring higher
security or transactional compliance.
3. What are Named Credentials, and why are they important in integrations?
Named Credentials store endpoint URLs and authentication details securely, simplifying
authentication and connection management for external systems, reducing callout complexity.
8. How do you ensure data consistency between Salesforce and an external system?
Implement transactional operations, use middleware for reliable message queuing, reconciliation
jobs, error monitoring, and employ locks or versioning to prevent conflicts.
Automation Questions
1. What are the differences between Workflow Rules, Process Builder, and Flow in Salesforce
automation?
Workflow Rules are simple and limited to field updates, email alerts, and tasks. Process Builder
offers more complex automations including record creation and invocation of Flows. Flow is the
most powerful, supporting complex logic, user interaction, and integration with Apex.
2. When would you choose to use Flow over Process Builder or Apex triggers?
Use Flow for complex multi-step automations requiring user interaction or updates to related
records without code. Apex is preferred when logic is too complex or performance-critical, and
Process Builder for simpler record-based automations.
3. How do you handle error handling and fault paths in Salesforce Flows?
Configure fault paths on elements like record updates or Apex calls to capture errors. Use fault
paths to notify admins, log errors, or perform corrective actions.
4. Describe a complex automation project you worked on and the challenges you faced.
Implemented a multi-step approval process with record updates and notifications using Flows.
The challenge was handling bulk limits and ensuring data consistency, addressed by batching and
careful flow design.
5. How do you optimize Flows to handle large data volumes and avoid governor limits?
Avoid excessive DMLs by consolidating updates, use scheduled or batch flows for large datasets,
and minimizing queries by passing variables effectively.
1. What is the purpose of Apex test classes, and what are the key requirements for writing
them?
Apex test classes verify code correctness, prevent regressions, and are required for deployment.
They must include test methods with test data, assert expected outcomes, and not depend on org
data.
2. How do you achieve code coverage in Apex, and what is the minimum coverage required for
deployment?
Write comprehensive tests covering positive, negative, and edge cases, aiming for over 75% code
coverage, which is the Salesforce minimum for deployment.
4. What are [Link]() and [Link]() methods used for in test classes?
They reset governor limits during testing and allow execution of asynchronous code
synchronously for accurate testing.
6. What is Salesforce DX, and how does it improve the development and deployment process?
Salesforce DX provides modern CLI tools, source-driven development, scratch orgs for isolated
dev, and integration with CI/CD for automated deployments.
7. Can you explain the different types of sandboxes in Salesforce and their use cases?
Types include Developer (small dev/testing), Developer Pro (larger dev/testing), Partial Copy
(partial production data for QA), and Full (copy of production for staging).
8. How do change sets work in Salesforce, and what are their limitations?
Change sets allow metadata deployment between related orgs using a GUI but lack automation,
support limited metadata types, and aren’t ideal for complex CI/CD.
10. How do you troubleshoot deployment failures in Salesforce? What steps do you follow?
Analyze error messages, fix validation or test failures, check dependencies and metadata types,
rerun failed tests, and use deployment logs for diagnosis.
Performance
1. What are Salesforce governor limits, and why are they important in Apex development?
Limits prevent resource monopolization in a multi-tenant environment, ensuring platform
stability and fair resource allocation.
2. Can you explain common governor limits related to SOQL queries and DML operations?
Limits include max 100 SOQL queries and 150 DML operations per transaction, enforcing efficient
resource use.
3. How do you avoid hitting the "Too many SOQL queries: 101" governor limit in Apex
triggers?
Bulkify code by moving SOQL queries outside loops and using collections to query all needed data
in one call.
5. Describe how you optimize Apex code to stay within CPU time limits.
Remove inefficient loops, minimize SOQL/DML calls, leverage asynchronous processing, and cache
reusable data.
6. How do you handle large data volumes in Salesforce while respecting governor limits?
Use Batch Apex, Queueable Apex, or scheduled Apex for asynchronous bulk processing and data
partitioning.
7. What best practices do you follow when writing triggers to prevent recursive calls and
hitting limits?
Use static variables to control recursion, call helper classes, and separate logic from triggers.
9. How do you monitor and debug governor limit issues during development?
Use debug logs, Limits class methods to check consumption, and Salesforce Developer Console
tools.
10. What techniques do you use to optimize SOQL queries for performance?
Use selective filters, limit fields queried, use indexed fields, avoid nested queries, and paginate
large result sets.
Change Management
1. What are the different types of Salesforce sandboxes, and when would you use each type in
a release cycle?
Developer for coding, Developer Pro for more extensive dev, Partial Copy for QA with sample data,
Full sandbox for staging and user acceptance testing.
2. How do you manage sandbox refresh schedules to minimize disruption in your
development and testing workflows?
Coordinate refresh during low activity, communicate with teams, and perform post-refresh
configuration and data setup early.
3. Can you explain the purpose of change sets and what their limitations are in deployment?
Change sets deploy metadata between related orgs without scripts, but lack automation and are
limited in complex metadata support.
4. Describe best practices for managing metadata and configuration changes across multiple
sandboxes before deploying to production.
Use source control, document changes, validate in scratch and full sandboxes, run all tests pre-
deployment, and follow deployment checklists.
5. How do you handle post-refresh tasks in sandboxes, such as masking sensitive data or
updating endpoints?
Run anonymization scripts, update workflow/email templates, reset integrations and Named
Credentials, and conduct smoke testing.
List<Contact> contactsToUpdate = [SELECT Id, AccountId FROM Contact WHERE AccountId IN :accountIds];
for (Contact con : contactsToUpdate) {
[Link] = [Link]([Link]).BillingCity;
}
update contactsToUpdate;
}
Covers: Parent-child relationship handling, bulk-safe pattern.
Covers all Apex concepts (Triggers, Classes, Batch, Async, Exception handling)
Shows best practices (bulkification, handler pattern, governor limit safety)
Includes dynamic SOQL, future methods, and test class (commonly asked)
Demonstrates real business use cases (discounts, validations, parent-child updates)
• update the related Account's Last_Order_Date__c (with FOR UPDATE lock to avoid races)
• there’s a daily batch that archives old orders (partial success aware) and sends a summary email
if ([Link]) {
if ([Link]) [Link]([Link]);
if ([Link]) {
if ([Link]) [Link]([Link]);
}
public static void beforeUpdate(List<Order__c> newOrders, Map<Id, Order__c> oldMap) {
if (![Link]()) [Link](toProcess);
if ([Link]) return;
[Link] = true;
[Link]([Link]);
if (![Link]()) {
[Link](newlyConfirmed);
[Link] = false;
}
4) OrderService — core business logic (sync updates + event publishing +
queueing)
public class OrderService {
public Id orderId;
if ([Link]()) return;
if () {
[Link](oid);
[Link](oid);
if ([Link]()) return;
FROM Order__c
WHERE Id IN :toProcess
WITH SECURITY_ENFORCED];
// Update account last order date using FOR UPDATE (locks to avoid concurrent updates)
List<Account> accounts = [SELECT Id, Last_Order_Date__c FROM Account WHERE Id IN :acctIds FOR UPDATE];
[Link](o.Account__c).Last_Order_Date__c = [Link]();
// Savepoint usage to rollback account update if something goes wrong further in process
Savepoint sp = [Link]();
try {
update accounts;
[Link](sp);
// Log and continue: don't block posting platform events or async calls for other orders
// Publish platform event for high-value orders and collect for async sync
if (o.High_Value__c == true) {
OrderId__c = [Link]([Link]),
Amount__c = o.Total_Amount__c,
AccountId__c = [Link](o.Account__c)
);
[Link](evt);
[Link]([Link]);
// Enqueue a single Queueable job to sync inventory for these orders (batch them)
if (![Link]()) {
// Example: dynamic SOQL utility to get top N products sold (illustrates aggregate & dynamic)
String q = 'SELECT Product__c, COUNT(Id) totalSold FROM Order_Line_Item__c GROUP BY Product__c ORDER BY
COUNT(Id) DESC LIMIT ' + topN;
return [Link](q);
// Demonstrates partial insert with allOrNone = false for Order Line Items
if (saveResults[i].isSuccess()) {
} else {
return results;
if ([Link]()) return;
List<Order__c> ords = [SELECT Id, Name, Total_Amount__c, Account__c FROM Order__c WHERE Id IN :orderIds];
for (Order_Line_Item__c li : [SELECT Id, Order__c, Product__c, Quantity__c FROM Order_Line_Item__c WHERE Order__c IN :orderIds]) {
[Link](li.Order__c).add(li);
};
if ([Link]([Link])) {
});
[Link](p);
// Call external API (use Named Credential in real org; here we demonstrate manual callout)
// NOTE: replace endpoint with Named Credential or remote site setting in production
[Link]('[Link]
[Link]('POST');
[Link]('Content-Type', 'application/json');
[Link](jsonBody);
try {
} else {
// you might create an error record, platform event, or queue a retry job here
return [Link]('SELECT Id, Status__c, LastModifiedDate FROM Order__c WHERE LastModifiedDate <
LAST_N_DAYS:365 AND Status__c != \'Archived\'');
o.Status__c = 'Archived';
if (!res[i].isSuccess()) {
[Link]('Failed to archive Order Id: ' + scope[i].Id + ' Error: ' + res[i].getErrors()[0].getMessage());
}
}
[Link](new String[]{'ops@[Link]'});
[Link](new [Link][]{mail});
[Link]('Content-Type', 'application/json');
[Link]('{"status":"success","reserved":true}');
[Link](200);
return res;
List<[Link]> res =
[Link](lines);
// one success, one failure (expected)
Integer successCount = 0;
for ([Link] r : res) if ([Link]) successCount++;
[Link](successCount >= 0, 'At least zero success, this test shows partial
insert handling');
}
}
• Trigger Handler Pattern: OrderTrigger delegates to OrderTriggerHandler. This makes logic testable, maintainable,
and prevents multi-branch spaghetti in triggers.
• FOR UPDATE: We lock Account records with FOR UPDATE when updating Last_Order_Date__c to avoid concurrency
problems when many orders confirm at once.
• WITH SECURITY_ENFORCED: Used to enforce field & object-level security in queries (good for managed packages or
to avoid leaking data).
• Asynchronous Processing: InventorySyncQueueable is used for callouts and background processing. It implements
[Link].
• Callout Mocking in Tests: InventoryCalloutMock and [Link] allow testing queueable callouts. Wrap
[Link]() operations in [Link]()/[Link]() to execute async in tests.
• Batch with Partial Success: [Link](scope, false) allows partial successes; we iterate [Link][]
to log or handle errors.
• Savepoint & Rollback: When updating Accounts, we use a Savepoint and [Link] to avoid leaving accounts
in partial inconsistent states if something else fails.
• Platform Events: Publishing High_Value_Order_Event__e demonstrates event-driven architecture; other systems can
subscribe to react to high-value orders asynchronously.
• Partial DML & Error Handling: [Link]() uses [Link](..., false) and returns
detailed OrderProcessingResult objects so caller can decide next steps, retries, or user messages.
• Dynamic SOQL & Aggregates: getTopProducts() shows dynamic query building for aggregate results; useful for
dashboards and ad-hoc reporting.
• Test Coverage: Tests exercise trigger logic, queueable callouts, batch execution, and partial DML. Use
[Link]()/[Link]() for async behavior.
• Use Named Credentials for external endpoints (safer than hard-coded endpoints), and put endpoint in
[Link]('callout:My_Named_Cred').
• Add retry logic (exponential backoff) if inventory callouts fail frequently — you can store failed order ids in a custom
object and have a scheduled retry job.
• Add custom metadata to store thresholds (e.g., high value = 10000) rather than hard-coding.
• Handle complex business scenarios (Multi-object updates, Approval integration, Error handling)
• Cover newer Flow features (MFA screen components, Reactive screen components, HTTP callouts from Flow,
Migrate from Workflow/Process Builder)
Best Practice: Use Fault Paths on Create/Update elements to capture errors and display them to user.
Key Point: Platform Event Flow runs asynchronously → no transaction lock issues .
Best Practice: Use Reactive Screens to dynamically show/hide components without extra screens.
Key Point: Use Scheduled Flows for soft delete/archive tasks without Apex.
Key Point: Use Fault Paths for Case creation failures and show friendly error message.
8. Platform Event Flow – Real-Time Inventory Update
Platform Event Raised: New Order Placed
↓
Get Related Product Inventory
↓
Assignment: Reduce Stock Quantity = OrderedQty
↓
Update Product Records
↓
Decision: Stock < Reorder Level?
↓
Yes
↓
Send Reorder Email to Procurement
↓
End
Key Point: This prevents overselling and triggers restocking automatically.