Close Menu
SalesforceCodex
    Facebook X (Twitter) Instagram
    Trending
    • How to Build a Generic Modal Window in Lightning Web Component
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    • How to Suppress PMD Warnings in Salesforce Apex
    • Top 10 PMD Issues Salesforce Developers Should Focus on in Apex
    • How to Use Graph API for Outlook-Salesforce Connection
    Facebook X (Twitter) Instagram
    SalesforceCodex
    Subscribe
    Thursday, May 29
    • Home
    • Architecture
    • Salesforce
      • News
      • Apex
      • Integration
      • Books Testimonial
    • Questions
    • Certification
      • How to Prepare for Salesforce Integration Architect Exam
      • Certification Coupons
    • Integration Posts
    • Downloads
    • About Us
      • Privacy Policy
    SalesforceCodex
    Home»Question»Top 20 Salesforce Developer Interview Questions

    Top 20 Salesforce Developer Interview Questions

    Dhanik Lal SahniBy Dhanik Lal SahniJanuary 17, 2020Updated:May 17, 20237 Comments15 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    Top 20 Salesforce Developer Interview Questions
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Top 20 Salesforce Developer Interview Questions

    This post has the top 20 questions related to Salesforce integration and asynchronous apex.  Asynchronous apex and integration are very important for processing large data sets. Salesforce Developer Interview Questions

    1. Why do we need integration in Salesforce?
    Ans.
    Integration comes into the picture when some interaction is required from an external system. Let us take an example, we want to validate the address of the account record. This can be done using Google address validation or smarty street API integration.

    2. What are the types of integration patterns in salesforce?
    Ans.

    PatternDescription
    Remote Process Invocation—Request and ReplyThis pattern will come into the picture when we call any external website and wait for its response.
    Example: For verifying address, call address validation API and based on the response update flag in the system.
    Remote Process Invocation—Fire and ForgetThis pattern will come into the picture when we call any external website and don’t wait for its response.
    Example: For updating the external system, send data using consuming API.
    Batch Data SynchronizationData is created or updated from an external system or we send data to an external system using batch.
    Example: Send batch update for transaction amount updation on a daily basis.
    Remote Call-InRecord is created, updated, deleted, or retrieved in our system using an external system.
    Example: External system will update order detail in salesforce.
    UI Update Based on Data ChangesSalesforce user interface changes based on updation in record data
    Example: A customer service rep is on the phone with a customer working on a case record. The customer makes a payment, and the customer service rep does a real-time update in Salesforce from the payment processing application, indicating that the customer has successfully paid the order’s outstanding amount.
    Data VirtualizationSalesforce accesses external data in real-time. This removes the need to persist data in Salesforce and then reconcile the data between Salesforce and the external system.
    Example:
    Orders are managed by an external (remote) system. Sales reps want to view and update real-time order information in Salesforce without having to learn or use the external system.

    3. What is Asynchronous Apex?
    Ans. 
    Asynchronous Apex is used to run processes in a separate thread at a later time in the background. Mostly these are used where a large volume of data processing is required or based on HTTP callout some update in the record is required.

    4. What are types of Asynchronous Apex?
    Ans.
    Majorly there are four types which are as follows.
    1. Queueable Apex
    2. Scheduled Apex
    3. Batch Apex
    4. Future Methods

    5. In which scenario Batch Apex, Queueable Apex, and future method should use?
    Ans.

    Batch Apex:
    Batchable Apex is designed to allow for heavy asynchronous processing. It required a long time to process and was often used only to handle callouts or things that were slightly longer than a normal transaction could handle. Basically, it is used for large data volumes with long-running jobs.
    Future Methods:
    Unlike Batchable methods, they were lighter on resources and perfect for doing the job that Batchable were doing before, but much more efficiently. Future methods are used to isolate DML operations on different sObject types to prevent mixed DML errors. A mixed DML error occurs in a synchronous mode where in the same transaction insert and update commands are fired.
    Queueable Apex:
    Ans. Queueable is a hybrid between the limited future methods and the resource-hungry Batchable interface. Queueable is lighter than Batchable. It gives a Job ID and lets us store complex data patterns.

    6. Why we can’t pass sObject in future methods?
    Ans.
    Future methods are executed in their own time. sObject might change between the time it is called the method and the time it executes.

    7. What is the future call limit?
    Ans. The maximum
    number of future method invocations per a 24-hour period is 250,000 or the number of user licenses in the organization multiplied by 200, whichever is greater.

    8. How many child jobs can be created in Queueable Apex?
    Ans.
    Only 1 child job can be created for 1 parent job. There is no limit to the depth of the chaining job. For developer and trial, the maximum chaining depth is 5. It means a total of 4 chain jobs will be possible.

    9. To process 10000 records with HTTP Callout, what could be a better approach in queueable apex?
    Ans.
    Create two queueable jobs in this scenario. One queueable job will get all records using SOQL and map. Pass the map list to another job where the chaining job will be created for all records.
    Example:
    Child Job Class:

    public class LetterChildJob implements Queueable, Database.AllowsCallouts{
        Map<Id,Letter__c> lettersToProcessed;
        public LetterChildJob (Map<Id, Letter__c> letters)
        {
            lettersToProcessed=letters;
        }
        public void execute(QueueableContext context) {
            integer counter=0;
            boolean createNewQue=false;
            try
            {
                for(ID index:lettersToProcessed.keySet())
                {
                    // do the process
                    // remove object from lettersToProcessed once process completed by HttpCallout
                    counter=counter+1;
                    if(counter>98)
                    {
                        createNewQue=true;
                        break;
                    }
                }
                if(createNewQue)
                {
                    LetterChildJob esync = new LetterChildJob (lettersToProcessed);
            		System.enqueueJob(esync);
                }
            }
        	catch(Exception ex)
            {
                //Exception logic
            }
        }
    }
    

    Parent Job Class:

    public class LetterParentJob implements Queueable, Database.AllowsCallouts{
        public void execute(QueueableContext context) {
            Map<Id,Letter__c> letters=new Map<id, Letter__c >([Select id,LETTER_TYPE_ID__c ,Name from Letter__c where Letter_sent__c==false]);
            LetterChildJob esync = new LetterChildJob (letters);
            System.enqueueJob(esync);
        }
    }
    

    10. What is the maximum limit for callout in any job?
    Ans.
    100 callouts can be done in one job. If it will exceed then the max callout exceeds exception will throw.

    11. Why we can’t call a future method from another future method?
    Ans.
    If an @future method could be called from another @future method, one could have a chain of indeterminate length or even create a loop that would extend the execution of a transaction indefinitely through a very complex logic of additional execution contexts. Tracing the transaction to completion could become very complex.

    12. How to avoid the error “Too many queueable jobs added to the queue”?
    Ans.
    There is a limitation that multiple queueable jobs cannot create by batch or another queueable job. To avoid that situation, we can do chaining of queueable jobs.

    13. Is there a way to chain jobs indefinitely?
    Ans.
    Ideally, there is no limit for chaining of jobs but for test and developer editions it is a maximum of 5.

    14. Can I begin a batch job upon completion of another batch job?
    Ans.
    Yes, we can start a new batch when the first batch is completed. This is done in the finish method. Example: We want to send emails to all customers which are processed using batch.

    15. How to avoid error “System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out”?
    Ans.
    This error normally comes when we are running a job with multiple records and for each record, there is a callout. Based on the callout response we need to update the record in the system.Reason: Actually, web service or HTTP callouts and a DML won’t take place in the same transaction.
    Solution:
    1. We can use Queuable Apex with a callout to handle this error.
    2. We can divide DML and callout in separate transactions.

    16. Is it possible to get the ApexJobId within the Future method apex code or from the method its invoked from?
    Ans.
    No, Future is designed in response to Batchable’s excessive resource usage and cumbersome interface. It is work as a “fire and forget” type mechanism. It means that you can’t link any given future call to a Job ID reliably in Apex Code.

    17. How to find the status of a job that is created from Database.executeBatch?
    Ans.
    We can use AsyncApexJob for getting the status of the job.
    Example:

    SELECT Id, Status, ApexClassID, JobItemsProcessed, TotalJobItems, JobType, CompletedDate, ExtendedStatus FROM AsyncApexJob WHERE Id =: 'id' 
    

    18. How to get the class name that has executed the job?
    Ans. The asyncApexJob
    object has this information. We can use the below query for this.

    Select  Status, ApexClassId, ApexClass.Name  From AsyncApexJob
    

    19. How to delete old scheduled jobs?
    Ans.
    We have to purge old job records using the purgeOldAsyncJobs method. The code will be like below

    global void finish(Database.BatchableContext BC)
    {
      System.purgeOldAsyncJobs(Date.today());
    }
    

    20. How to delete future scheduled jobs?
    Ans.
    We should delete future jobs using System.abortJob. We have to get a scheduled job using CronTrigger and then pass it to System.abortJob.

    for(CronTrigger ct:[SELECT Id FROM CronTrigger]) {
      System.abortJOb(ct.Id);
    }
    

    Other Interview Question Posts

    Salesforce Interview Question for Asynchronous Apex

    Salesforce Integration Interview Questions

    Difference between Salesforce WSDL Files

    Salesforce Apex Interview Question

    Salesforce Security Interview Question

    Difference Between Workflow and Process Builder In Salesforce Development

    This post has the top 20 questions related to Salesforce integration and asynchronous apex.  Asynchronous apex and integration are very important for processing large data sets. Salesforce Developer Interview Questions

    1. Why do we need integration in Salesforce?
    Ans.
    Integration comes into the picture when some interaction is required from an external system. Let us take an example, we want to validate the address of the account record. This can be done using Google address validation or smarty street API integration.

    2. What are the types of integration patterns in salesforce?
    Ans.

    PatternDescription
    Remote Process Invocation—Request and ReplyThis pattern will come into the picture when we call any external website and wait for its response.
    Example: For verifying address, call address validation API and based on the response update flag in the system.
    Remote Process Invocation—Fire and ForgetThis pattern will come into the picture when we call any external website and don’t wait for its response.
    Example: For updating the external system, send data using consuming API.
    Batch Data SynchronizationData is created or updated from an external system or we send data to an external system using batch.
    Example: Send batch update for transaction amount updation on a daily basis.
    Remote Call-InRecord is created, updated, deleted, or retrieved in our system using an external system.
    Example: External system will update order detail in salesforce.
    UI Update Based on Data ChangesSalesforce user interface changes based on updation in record data
    Example: A customer service rep is on the phone with a customer working on a case record. The customer makes a payment, and the customer service rep does a real-time update in Salesforce from the payment processing application, indicating that the customer has successfully paid the order’s outstanding amount.
    Data VirtualizationSalesforce accesses external data in real-time. This removes the need to persist data in Salesforce and then reconcile the data between Salesforce and the external system.
    Example:
    Orders are managed by an external (remote) system. Sales reps want to view and update real-time order information in Salesforce without having to learn or use the external system.

    3. What is Asynchronous Apex?
    Ans. 
    Asynchronous Apex is used to run processes in a separate thread at a later time in the background. Mostly these are used where a large volume of data processing is required or based on HTTP callout some update in the record is required.

    4. What are types of Asynchronous Apex?
    Ans.
    Majorly there are four types which are as follows.
    1. Queueable Apex
    2. Scheduled Apex
    3. Batch Apex
    4. Future Methods

    5. In which scenario Batch Apex, Queueable Apex, and future method should use?
    Ans.

    Batch Apex:
    Batchable Apex is designed to allow for heavy asynchronous processing. It required a long time to process and was often used only to handle callouts or things that were slightly longer than a normal transaction could handle. Basically, it is used for large data volumes with long-running jobs.
    Future Methods:
    Unlike Batchable methods, they were lighter on resources and perfect for doing the job that Batchable were doing before, but much more efficiently. Future methods are used to isolate DML operations on different sObject types to prevent mixed DML errors. A mixed DML error occurs in a synchronous mode where in the same transaction insert and update commands are fired.
    Queueable Apex:
    Ans. Queueable is a hybrid between the limited future methods and the resource-hungry Batchable interface. Queueable is lighter than Batchable. It gives a Job ID and lets us store complex data patterns.

    6. Why we can’t pass sObject in future methods?
    Ans.
    Future methods are executed in their own time. sObject might change between the time it is called the method and the time it executes.

    7. What is the future call limit?
    Ans. The maximum
    number of future method invocations per a 24-hour period is 250,000 or the number of user licenses in the organization multiplied by 200, whichever is greater.

    8. How many child jobs can be created in Queueable Apex?
    Ans.
    Only 1 child job can be created for 1 parent job. There is no limit to the depth of the chaining job. For developer and trial, the maximum chaining depth is 5. It means a total of 4 chain jobs will be possible.

    9. To process 10000 records with HTTP Callout, what could be a better approach in queueable apex?
    Ans.
    Create two queueable jobs in this scenario. One queueable job will get all records using SOQL and map. Pass the map list to another job where the chaining job will be created for all records.
    Example:
    Child Job Class:

    public class LetterChildJob implements Queueable, Database.AllowsCallouts{
        Map<Id,Letter__c> lettersToProcessed;
        public LetterChildJob (Map<Id, Letter__c> letters)
        {
            lettersToProcessed=letters;
        }
        public void execute(QueueableContext context) {
            integer counter=0;
            boolean createNewQue=false;
            try
            {
                for(ID index:lettersToProcessed.keySet())
                {
                    // do the process
                    // remove object from lettersToProcessed once process completed by HttpCallout
                    counter=counter+1;
                    if(counter>98)
                    {
                        createNewQue=true;
                        break;
                    }
                }
                if(createNewQue)
                {
                    LetterChildJob esync = new LetterChildJob (lettersToProcessed);
            		System.enqueueJob(esync);
                }
            }
        	catch(Exception ex)
            {
                //Exception logic
            }
        }
    }
    

    Parent Job Class:

    public class LetterParentJob implements Queueable, Database.AllowsCallouts{
        public void execute(QueueableContext context) {
            Map<Id,Letter__c> letters=new Map<id, Letter__c >([Select id,LETTER_TYPE_ID__c ,Name from Letter__c where Letter_sent__c==false]);
            LetterChildJob esync = new LetterChildJob (letters);
            System.enqueueJob(esync);
        }
    }
    

    10. What is the maximum limit for callout in any job?
    Ans.
    100 callouts can be done in one job. If it will exceed then the max callout exceeds exception will throw.

    11. Why we can’t call a future method from another future method?
    Ans.
    If an @future method could be called from another @future method, one could have a chain of indeterminate length or even create a loop that would extend the execution of a transaction indefinitely through a very complex logic of additional execution contexts. Tracing the transaction to completion could become very complex.

    12. How to avoid the error “Too many queueable jobs added to the queue”?
    Ans.
    There is a limitation that multiple queueable jobs cannot create by batch or another queueable job. To avoid that situation, we can do chaining of queueable jobs.

    13. Is there a way to chain jobs indefinitely?
    Ans.
    Ideally, there is no limit for chaining of jobs but for test and developer editions it is a maximum of 5.

    14. Can I begin a batch job upon completion of another batch job?
    Ans.
    Yes, we can start a new batch when the first batch is completed. This is done in the finish method. Example: We want to send emails to all customers which are processed using batch.

    15. How to avoid error “System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out”?
    Ans.
    This error normally comes when we are running a job with multiple records and for each record, there is a callout. Based on the callout response we need to update the record in the system.Reason: Actually, web service or HTTP callouts and a DML won’t take place in the same transaction.
    Solution:
    1. We can use Queuable Apex with a callout to handle this error.
    2. We can divide DML and callout in separate transactions.

    16. Is it possible to get the ApexJobId within the Future method apex code or from the method its invoked from?
    Ans.
    No, Future is designed in response to Batchable’s excessive resource usage and cumbersome interface. It is work as a “fire and forget” type mechanism. It means that you can’t link any given future call to a Job ID reliably in Apex Code.

    17. How to find the status of a job that is created from Database.executeBatch?
    Ans.
    We can use AsyncApexJob for getting the status of the job.
    Example:

    SELECT Id, Status, ApexClassID, JobItemsProcessed, TotalJobItems, JobType, CompletedDate, ExtendedStatus FROM AsyncApexJob WHERE Id =: 'id' 
    

    18. How to get the class name that has executed the job?
    Ans. The asyncApexJob
    object has this information. We can use the below query for this.

    Select  Status, ApexClassId, ApexClass.Name  From AsyncApexJob
    

    19. How to delete old scheduled jobs?
    Ans.
    We have to purge old job records using the purgeOldAsyncJobs method. The code will be like below

    global void finish(Database.BatchableContext BC)
    {
      System.purgeOldAsyncJobs(Date.today());
    }
    

    20. How to delete future scheduled jobs?
    Ans.
    We should delete future jobs using System.abortJob. We have to get a scheduled job using CronTrigger and then pass it to System.abortJob.

    for(CronTrigger ct:[SELECT Id FROM CronTrigger]) {
      System.abortJOb(ct.Id);
    }
    

    Other Interview Question Posts

    Salesforce Interview Question for Asynchronous Apex

    Salesforce Integration Interview Questions

    Difference between Salesforce WSDL Files

    Salesforce Apex Interview Question

    Salesforce Security Interview Question

    Difference Between Workflow and Process Builder In Salesforce Development

    What is Monolithic Architecture?

    What is Microservice Architecture?

    apex batch apex future method integration Queueable salesforce salesforce apex Salesforce Developer Interview Questions salesforce integration interview questions Salesforce Interview Question
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleUploading Files to S3 Server using Apex
    Next Article Download Files From S3 Server using Apex
    Dhanik Lal Sahni
    • Website
    • Facebook
    • X (Twitter)

    With over 18 years of experience in web-based application development, I specialize in Salesforce technology and its ecosystem. My journey has equipped me with expertise in a diverse range of technologies including .NET, .NET Core, MS Dynamics CRM, Azure, Oracle, and SQL Server. I am dedicated to staying at the forefront of technological advancements and continuously researching new developments in the Salesforce realm. My focus remains on leveraging technology to create innovative solutions that drive business success.

    Related Posts

    By Dhanik Lal Sahni4 Mins Read

    How to Build a Generic Modal Window in Lightning Web Component

    May 26, 2025
    By Dhanik Lal Sahni6 Mins Read

    Top 10 Salesforce Flow Features of Salesforce Summer ’25

    May 11, 2025
    By Dhanik Lal Sahni6 Mins Read

    Unlock the Power of Vibe Coding in Salesforce

    April 30, 2025
    View 7 Comments

    7 Comments

    1. sayant on January 17, 2020 5:16 pm

      An excellent material

      Reply
      • Dhanik Lal Sahni on January 17, 2020 7:38 pm

        Thank You sayant.

        Reply
    2. Kishan on January 17, 2020 6:22 pm

      Thank You for sharing this nice blog

      Reply
      • Dhanik Lal Sahni on January 17, 2020 7:38 pm

        Thank You kishan.

        Reply
    3. Dhanik Lal Sahni on January 17, 2020 7:38 pm

      Thank You Abhishek.

      Reply
    4. Dhanik Lal Sahni on January 19, 2020 10:56 pm

      Thank You Abhimanyu.

      Reply
    5. Pingback: Difference Between With and Without Security in Apex

    Leave A Reply Cancel Reply

    Ranked #1 SALESFORCE DEVELOPER BLOG BY SALESFORCEBEN.COM
    Featured on Top Salesforce Developer Blog By ApexHours
    Recent Posts
    • How to Build a Generic Modal Window in Lightning Web Component
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    Ranked in Top Salesforce Blog by feedspot.com
    RSS Recent Stories
    • How to Connect Excel to Salesforce to Manage Your Data and Metadata February 9, 2025
    • Difference Between With Security and Without Security in Apex January 2, 2025
    • Top Reasons to Love Salesforce Trailhead: A Comprehensive Guide December 5, 2024
    • How to Utilize Apex Properties in Salesforce November 3, 2024
    • How to Choose Between SOQL and SOSL Queries July 31, 2024
    Archives
    Categories
    Tags
    apex (111) apex code best practice (8) apex rest (11) apex trigger best practices (4) architecture (22) Asynchronous apex (9) AWS (5) batch apex (9) batch processing (4) code optimization (8) code review tools (3) custom metadata types (5) design principle (9) file upload (3) flow (15) future method (4) google (6) google api (4) integration (19) integration architecture (6) lighting (8) lightning (64) lightning-combobox (5) lightning-datatable (10) lightning component (30) Lightning web component (62) lwc (51) named credential (8) news (4) optimize apex code (4) Permission set (4) pmd (3) Queueable (9) rest api (23) S3 Server (4) salesforce (141) salesforce apex (46) salesforce api (4) salesforce api integration (5) Salesforce Interview Question (4) salesforce news (5) salesforce question (5) solid (6) tooling api (5) Winter 20 (8)

    Get our newsletter

    Want the latest from our blog straight to your inbox? Chucks us your detail and get mail when new post is published.
    * indicates required

    Ranked #1 SALESFORCE DEVELOPER BLOG BY SALESFORCEBEN.COM
    Featured on Top Salesforce Developer Blog By ApexHours
    Recent Posts
    • How to Build a Generic Modal Window in Lightning Web Component
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    Ranked in Top Salesforce Blog by feedspot.com
    RSS Recent Stories
    • How to Connect Excel to Salesforce to Manage Your Data and Metadata February 9, 2025
    • Difference Between With Security and Without Security in Apex January 2, 2025
    • Top Reasons to Love Salesforce Trailhead: A Comprehensive Guide December 5, 2024
    • How to Utilize Apex Properties in Salesforce November 3, 2024
    • How to Choose Between SOQL and SOSL Queries July 31, 2024
    Archives
    Categories
    Tags
    apex (111) apex code best practice (8) apex rest (11) apex trigger best practices (4) architecture (22) Asynchronous apex (9) AWS (5) batch apex (9) batch processing (4) code optimization (8) code review tools (3) custom metadata types (5) design principle (9) file upload (3) flow (15) future method (4) google (6) google api (4) integration (19) integration architecture (6) lighting (8) lightning (64) lightning-combobox (5) lightning-datatable (10) lightning component (30) Lightning web component (62) lwc (51) named credential (8) news (4) optimize apex code (4) Permission set (4) pmd (3) Queueable (9) rest api (23) S3 Server (4) salesforce (141) salesforce apex (46) salesforce api (4) salesforce api integration (5) Salesforce Interview Question (4) salesforce news (5) salesforce question (5) solid (6) tooling api (5) Winter 20 (8)

    Get our newsletter

    Want the latest from our blog straight to your inbox? Chucks us your detail and get mail when new post is published.
    * indicates required

    Facebook X (Twitter) Instagram Pinterest YouTube Tumblr LinkedIn Reddit Telegram
    © 2025 SalesforceCodex.com. Designed by Vagmine Cloud Solution.

    Type above and press Enter to search. Press Esc to cancel.

    Ad Blocker Enabled!
    Ad Blocker Enabled!
    Our website is made possible by displaying online advertisements to our visitors. Please support us by disabling your Ad Blocker.