Backend Developer Interview Question

How do you make a service call to a dependency that might be slow or down?

What the interviewer is probing, how to structure your answer, and a spoken example you can adapt.

Quick answer

Set an explicit timeout on every call, shorter than the caller's own deadline, and never rely on the client library default. Retry only idempotent operations, with exponential backoff plus jitter and a small bounded attempt count. Add a circuit breaker so repeated failures fail fast instead of queuing, and define what degraded looks like: a cached value, a partial response, or a clear error rather than a hanging request.

Why interviewers ask this

Retries are the classic way a small incident becomes an outage, so this checks whether you understand retry amplification and the need for a global deadline. The interviewer wants specifics: jitter, budgets, idempotency as a precondition for retrying, and fallback behavior. Answers that just say add retries and a circuit breaker without discussing amplification suggest the concepts were read rather than operated.

How to structure your answer

  • Start with timeouts and deadline propagation.
  • State the precondition for retrying: the operation is idempotent.
  • Explain backoff, jitter and retry budgets to avoid amplification.
  • Define the degraded behavior the user actually gets.

Example answer

Spoken example, first person

The first thing is a timeout on every outbound call, chosen from the latency distribution rather than picked at random, and always shorter than the deadline I was given, so I fail before my caller gives up. I propagate that remaining deadline downstream, otherwise work continues on a request nobody is waiting for. Retries only apply to idempotent calls, and even then with exponential backoff and jitter, capped at two or three attempts. The reason for the cap is amplification: if every layer retries three times, a blip at the bottom becomes an order of magnitude more load, which is how a slow dependency turns into a full outage. So I also like a retry budget, where retries are limited to a small percentage of total requests. A circuit breaker sits on top so that once failures cross a threshold I fail immediately for a cooldown and probe occasionally, which stops me piling requests onto something already struggling. And I decide up front what degraded means; on a pricing service we served the last cached price with a staleness flag rather than failing checkout.

Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.

See how it works

Follow-up questions to expect

  • How do you decide the timeout value for a specific dependency?
  • What is retry amplification, and how do you detect it in metrics?
  • How does a circuit breaker decide when to close again?

Related backend developer questions

Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.

Predict my questions

Rehearse the hard questions before they are asked

Practise with a live copilot, then walk in ready. A $29 Session Pass gets you through the interview with no subscription and no lock-in.

Get GhostPilot