ApexSensei

All drills

Work in the background: Apex practice drills

Future methods, Queueable, Batch and Schedulable Apex.

6 drills · Advanced · Free to read, run with Apex Path ($19/month after a 7-day trial)

  1. Complete a Contact review in the future (Intermediate, 15 min)
    Turn a working synchronous method into a @future method that takes an Id, queries the Contact and saves the review later.
  2. Carry Account work in a Queueable (Intermediate, 18 min)
    Carry Account Ids and a label into a Queueable job, then update every target Account with one DML statement, even for 200 records.
  3. Build a Batch lifecycle (Advanced, 20 min)
    Implement start, execute, and finish so a Batch job processes selected Accounts and marks completion.
  4. Keep counts across Batch transactions (Advanced, 25 min)
    Add Database.Stateful so counts gathered in execute are still there when finish writes the summary.
  5. Schedule an Account review (Advanced, 22 min)
    Register a Schedulable class with a cron string, and keep the record work in execute so it runs only when the job fires.
  6. Make a Queueable retry idempotent (Advanced, 25 min)
    Keep every applied operation key on the record so a Queueable retry, even a late one, never applies the same work twice.

Start practicing free