0% found this document useful (0 votes)
47 views2 pages

Salesforce Batch Apex Interview Questions

A batch Apex class can be used to perform operations on large sets of data in Salesforce. It implements the Batchable interface which defines three methods - start, execute, and finish. The start method initializes the batch job and returns a QueryLocator. The execute method processes records returned from the QueryLocator in batches, and the finish method runs after all batches have processed to clean up. Batch Apex classes allow performing DML operations on large numbers of records, calling external web services, and more.

Uploaded by

teja ganesh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views2 pages

Salesforce Batch Apex Interview Questions

A batch Apex class can be used to perform operations on large sets of data in Salesforce. It implements the Batchable interface which defines three methods - start, execute, and finish. The start method initializes the batch job and returns a QueryLocator. The execute method processes records returned from the QueryLocator in batches, and the finish method runs after all batches have processed to clean up. Batch Apex classes allow performing DML operations on large numbers of records, calling external web services, and more.

Uploaded by

teja ganesh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

BATCH APEX QUESTIONS

1. When would you use a batch class in Salesforce?


a) When you want to perform a specific task on a large number of records
b) When you want to perform a specific task on a small number of records
c) When you want to perform a specific task on records in a particular object
d) All of the above

2. How do you create a batch class in Salesforce?


a) By creating a new Apex class and implementing the Batchable interface
b) By creating a new Apex class and extending the Batchable class
c) By creating a new Apex trigger and implementing the Batchable interface
d) By creating a new Apex trigger and extending the Batchable class

3. What is the maximum number of records that can be passed to a batch class at one time?
a) 1000
b) 10000
c) 100000
d) 1000000

4. What is the maximum number of records that can be processed by a batch class in a single
execution?
a) 1000
b) 10000
c) 100000
d) 1000000

5. What is the maximum number of batch classes that can be executed concurrently in
Salesforce?
a) 1
b) 5
c) 10
d) 25

6. Can a batch class be scheduled to run automatically in Salesforce?


a) Yes, using the Scheduled Apex feature
b) Yes, using the Time-Based Workflow feature
c) Yes, using the Process Builder feature
d) All of the above

7. Can a batch class be called from a trigger in Salesforce?


a) Yes, using the [Link]() method
b) Yes, using the [Link]() method
c) Yes, using the [Link]() method
d) All of the above

8. How do you test a batch class in Salesforce?


a) By creating test records and calling the start() method in a test method
b) By creating test records and calling the execute() method in a test method
c) By creating test records and calling the finish() method in a test method
d) All of the above

9. Can a batch class be used to update records in a different object than the object it is
processing?
a) Yes, using cross-object formulas
b) Yes, using cross-object triggers
c) Yes, using cross-object workflow rules
d) All of the above

10. Can a batch class be used to delete records in Salesforce?


a) Yes, by calling the delete() method on each record in the execute() method
b) Yes, by calling the delete() method on the QueryLocator object in the start() method
c) Yes, by calling the delete() method on the [Link]() method in the
finish() method
d) All of the above

11. Can a batch class be used to insert records in Salesforce?


a) Yes, by calling the insert() method on each record in the execute() method
b) Yes, by calling the insert() method on the QueryLocator object in the start() method
c) Yes, by calling the insert() method on the [Link]() method in the finish()
method
d) All of the above

12. Can a batch class be used to upsert records in Salesforce?


a) Yes, by calling the upsert() method on each record in the execute() method
b) Yes, by calling the upsert() method on the QueryLocator object in the start() method
c) Yes, by calling the upsert() method on the [Link]() method in the finish()
method
d) All of the above

13. Can a batch class be used to send emails in Salesforce?


a) Yes, by calling the [Link]() method in the execute() method
b) Yes, by calling the [Link]() method in the start() method
c) Yes, by calling the [Link]() method in the finish() method
d) All of the above

14. Can a batch class be used to call a REST API in Salesforce?


a) Yes, by calling the [Link]() method in the execute() method
b) Yes, by calling the [Link]() method in the start() method
c) Yes, by calling the [Link]() method in the finish() method
d) All of the above

15. Can a batch class be used to perform callouts to external systems in Salesforce?
a) Yes, by calling the callout methods in the execute() method
b) Yes, by calling the callout methods in the start() method
c) Yes, by calling the callout methods in the finish() method
d) All of the above

You might also like