Design Retry and Dead Letter Handling for Failed Background Jobs
Last updated: November 29, 2026
Quick Overview
Design how a background job system retries failed jobs and moves permanently failing ones to a dead letter queue where engineers can inspect, fix, and replay them, for example for Google Play receipt verification jobs.
0
0
0 solved
Design how a background job system retries failed jobs and moves permanently failing ones to a dead letter queue where engineers can inspect, fix, and replay them, for example for Google Play receipt verification jobs.
This is a compact reliability question that shows up early in Google loops for backend roles. The interviewer is checking that you know transient versus permanent failures, bounded retries with backoff, and a safe replay story.
What the Interviewer Expects
- Classify errors as transient or permanent
- Use exponential backoff with jitter and a max attempt count
- Move exhausted jobs to a dead letter queue with failure context
- Provide inspection and replay tooling
- Alert on dead letter growth
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How do you replay 10,000 dead-lettered jobs without overloading the downstream?
- What if a replayed job fails again?
- How do you avoid one poison job blocking a whole partition?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
- Jobs come from a queue (for example Pub/Sub). Some fail due to downstream outages (transient), others due to bad data (permanent).
- Retry transient failures automatically; stop retrying after a lim...
High-Level Design
Worker pulls a job, processes it, and acks on success. On failure it either nacks with a delay (retry) or, after max attempts, publishes the job plus metadata (error, stack, attempts, timestamps) to a...