Salesforce Developer Interview Questions – Asynchronous Apex – Queueable Apex
Queueable Apex
Table of Contents
153. What is a queueable apex?
Answer
Queueable apex is one of the types of asynchronous apex. It is similar to @future method. But queueable apex provide these additional benefits
- Getting an Id for your job : When we submit the job using the system.enqueueJob method it returns the ID of the new job.
- Using non-primitive types : Our queueable class can contain member variables of non-primitive data types such as sObjects or custom apex types. Those objects can be accessed when the job executes.
- Chaining jobs: we can chain jobs to another job by starting a second job from a running job. Chaining jobs is useful if our process depends on another process to have run first.
154. Which interface is implemented for Queueable class?
Answer
Queueable class implements Queueable
155. Can you write the sample code for a queueable class?
Answer
![](https://www.ashfaqmohammed.com/wp-content/uploads/2023/09/154-Quable-class-1024x287.png)