All jobs / Backend developer / Distributed Systems
Backend developer interview question · 1–3 years
The interviewer asks: “Your HTTP client has no timeout. What's the risk?” Strongest answer?
The strongest answer
A hung dependency holds a thread/connection forever, the pool drains, and the whole API dies with it. I set connect and request timeouts on every outbound call — including the database.
Why it works
Exactly. Timeouts are blast-radius control. No timeout is an unbounded distributed deadlock.
What a good answer covers
- Every outbound call has a timeout.
- Hung deps shouldn't eat the pool.
- Timeouts are a feature, not noise.
- Don't convert them into fake 200s.
Answers that fall short
- Close, but not the strongest: It might be a bit slower sometimes; I'll add a timeout if we see hangs.
You will see hangs — as a site-wide incident. Default them now. - Weak: Timeouts cause more errors, so I leave them off in production.
Timeouts turn infinite waits into bounded 504/503s you can SLO. That's the point. - Red flag: I catch the timeout and ignore it so the request still returns 200.
200 after a failed write is a silent inconsistency. Surface the failure or compensate; don't swallow it.
Who gets asked this
More Distributed Systems questions
- A RabbitMQ consumer acknowledges each message as soon as it arrives and then processes it. Messages go…
- The interviewer asks: “Your queue consumer ran twice for the same message. What do you do?” Strongest answer?
- What do you tell them, and what does it force on your code?
- The interviewer asks: “The replica is behind. Do you serve stale reads or error?” Strongest answer?
- The interviewer asks: “How do you publish an event only if the order row actually committed?” Strongest…
- The interviewer asks: “We need “all services succeed or none” across order, inventory and billing. What do…
- The interviewer asks: “Consumers are slow. The publisher is fast. What do you do?” Strongest answer?
- The interviewer asks: “A message fails every time. The consumer keeps retrying. What now?” Strongest answer?