Design a scalable async processing pipeline for spiky, long-running work (think video transcoding or report generation). Walk me through the queue-based architecture and its failure modes.
What they are really testing: Whether you reach for a queue to decouple producers from consumers, and whether you reason about the unglamorous parts: backpressure, retries, idempotency, poison messages, and visibility. They want the failure modes, not just the happy-path box diagram.
A real interview question
Design a scalable async processing pipeline for spiky, long-running work (think video transcoding or report generation). Walk me through the queue-based architecture and its failure modes.
What most people say
drag me
“The API call does the processing and returns the result when it is done. If it gets slow we add more servers.”
Doing long work inside the request couples the caller to the slowest job, times out under spikes, and loses work on a crash. There is no decoupling, no retry story, and no handling of duplicate or poison messages, which are the actual operational realities of a pipeline.
The follow-ups they ask next
One malformed job keeps crashing your workers and they keep retrying it. What happens to the rest of the queue?
Without a dead-letter queue, the poison message is redelivered forever and can starve or wedge the consumer fleet. The fix is a maxReceiveCount that routes the message to a DLQ after N attempts, plus an alarm on DLQ depth so a human investigates the bad job instead of it silently burning capacity.
Why not just chase exactly-once delivery and skip the idempotency work?
True exactly-once across a distributed boundary is very hard and usually means at-least-once delivery plus idempotent consumers under the hood anyway. Building idempotent workers is cheaper, more robust, and protects you even when the broker redelivers, so the senior move is at-least-once plus idempotency, not a quest for exactly-once.
What the interviewer is listening for
- Decouples producers from consumers with a queue
- Makes workers idempotent for at-least-once delivery
- Uses a DLQ and visibility timeout for poison/crash handling
- Autoscales on queue depth and alarms on queue age
What sinks the answer
- Does long work inside the request path
- Assumes each message is delivered exactly once
- No dead-letter or retry-limit strategy
- Scales on CPU instead of queue depth
If you genuinely do not know
Say this instead of freezing. Reasoning out loud from what you do know beats silence every single time, and a good interviewer is listening for exactly that.
“I clarify [spikiness, job duration, ordering, sync vs async result]. Producers [enqueue and return a job id]; workers [pull from the queue and autoscale on depth]. Because delivery is [at-least-once], workers are [idempotent via a key]. For failure I add [visibility timeout, a DLQ after N retries, alarms on DLQ/queue age]. Trade-offs: [at-least-once + idempotency over exactly-once], [FIFO only if ordering is required].”
Keep going with architecture & design
Junior
How does putting a load balancer in front of your app improve availability, and what does it NOT solve?
Junior
What is autoscaling, and how does it decide when to add or remove instances?
Senior
Design a highly available web application on AWS. Walk me through the architecture and your trade-offs.
Senior
Design a disaster recovery strategy for a revenue-critical workload on AWS. How do you pick between backup-and-restore, pilot light, warm standby, and active-active?
Senior
You own a system of many services and an incident took too long to diagnose. Design an observability strategy across the whole estate.
Senior
Design a CI/CD pipeline that lets a team deploy many times a day safely. How do you make production changes low-risk with progressive delivery?
Knowing the answer is not the same as recalling it under pressure
Sign in to send the questions you fumble to spaced recall, so they come back right before you would forget them, and learn the concepts behind them with hands-on labs.
Start free