Suggested answer

Queueable Apex (implementing Queueable interface) runs asynchronously. Advantages over @future:

1. Accepts non-primitive parameters (sObjects, custom types, collections).
2. Returns a job ID for monitoring via AsyncApexJob.
3. Can be chained — enqueue another Queueable within execute() (max chain depth of 5 in dev/sandbox, unlimited in production, but limited to avoid infinite chains).
4. Can make callouts if Database.AllowsCallouts is implemented.
5. Can be called from Batch Apex. Usage: System.enqueueJob(new MyQueueable()); Testing: wrap in Test.startTest() / Test.stopTest() to force synchronous execution. Ideal for jobs that need object parameters or chaining patterns.

Practice content for interview preparation; not an official vendor answer. Verify details against current product documentation.

Community comments (0)

No comments yet.

Sign in or create a free account to add a comment. Comments are moderated before they appear.

Plain text only, 3–2000 characters. A moderator reviews every comment before it is published.