A message queue is growing and consumers are not keeping up. What do you do, in what order?
What they are really testing: Whether you understand that scaling consumers is sometimes wrong, and whether you can reason about poison messages and downstream limits before adding capacity.
A real interview question
A message queue is growing and consumers are not keeping up. What do you do, in what order?
What most people say
drag me
“Scale up the number of consumers until the queue drains.”
It is right only in one of the four common cases. If consumers are crashing, if there is a poison message, or if the real bottleneck is a downstream database, more consumers either does nothing or actively worsens throughput through contention.
The follow-ups they ask next
The backlog will take 8 hours to clear even at full capacity. What do you propose?
Ask whether old messages still have value. Options are prioritising recent ones, processing the backlog on separate capacity so live traffic is unaffected, or dropping messages beyond a staleness threshold if the business accepts it.
How do you spot a poison message quickly?
Look for a redelivery count climbing on specific messages, or repeated identical errors in consumer logs. A dead letter queue with a delivery limit turns this from an outage into a small pile to inspect later.
What the interviewer is listening for
- Refuses to scale before finding the bottleneck
- Raises poison messages and dead letter queues
- Knows adding consumers can reduce throughput
What sinks the answer
- Scales as the first move
- No consideration of downstream limits
- No plan for an unrecoverable backlog
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 would not scale first. Check [arrival rate up versus processing time up], [are consumers actually healthy or crash-looping], [is there a poison message being redelivered forever, which needs a dead letter queue], and [what consumers are blocked on, since more consumers against a saturated database reduces throughput]. Then [scale], and for a deep backlog [consider prioritising or shedding].”
Keep going with troubleshooting
Junior
A developer says the build passes locally but fails in CI. How do you debug that?
Junior
A production server is failing writes. Disk is 100% full. Walk me through what you do.
Junior
At midnight everything started failing with TLS errors. What happened and what do you do?
Mid
A pod is in CrashLoopBackOff after a deploy. Walk me through your debugging, command by command.
Mid
The deploy reports success, pods are Running, but users get 502s. Where do you look?
Mid
A Kubernetes node goes NotReady and pods are stuck Terminating. What is happening and what do you do?
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