Start here. This is the direct spoken answer to practice first.
Why this question matters
Background jobs fail differently from request/response code. This drill tests whether the candidate thinks about retries, duplicate processing, shutdown, and irreversible side effects.
A background job should handle cancellation so the worker can shut down cleanly, but it also needs to be safe if it is retried. Idempotency means running the same job more than once should not create duplicate side effects. For example, if a job sends an invoice email or charges a payment, I need a way to know whether that action already happened. Cancellation should not leave the system in an unknown state without a recovery path.