All jobs / Backend developer / Distributed Systems
Backend developer interview question · 3–5 years
The interviewer asks: “A message fails every time. The consumer keeps retrying. What now?” Strongest answer?
The strongest answer
Bounded retries, then a dead-letter / poison queue with an alert. I don't block the partition on one bad payload, and I don't drop it silently.
Why it works
Exactly. Poison messages are a first-class ops path: isolate, alarm, replay after a fix. That's how you keep the rest of the topic flowing.
What a good answer covers
- Retry a little, then dead-letter.
- Alert on the poison pile.
- Don't ack failures.
- Don't stop the world for one payload.
Answers that fall short
- Close, but not the strongest: Increase retries to 10,000 so it eventually works.
Infinite hope is a hot loop and a cloud bill. If it's invalid JSON, 10,000 won't help. - Weak: Catch Exception and ack so the queue moves.
Ack-on-error is silent data loss. That's how money events vanish. - Red flag: Delete the consumer until someone fixes the data.
Stopping the consumer piles up everything else. Park the one message.
Who gets asked this
More Distributed Systems questions
- Order-status events for the same order are arriving out of order at the consumer. The topic has twelve…
- The interviewer asks: “The user saves a profile then immediately GETs it from another region and sees the old…
- The interviewer asks: “A dependency is failing. How do you stop your service from dying with it?” Strongest…
- The interviewer asks: “The outbox publisher crashed after sending but before marking sent. What happens?”…
- The interviewer asks: “Recommendations are down. Checkout still needs to work. What do you do?” Strongest…
- The interviewer asks: “We're adding a search index. Can the API write DB and Elasticsearch in one request?”…
- What happened, and what actually protects the write?
- The interviewer asks: “Active-active in two regions — what's the hard part?” Strongest answer?