What does a load balancer do during a deployment, and how does it know an instance is ready?
What they are really testing: The connection between deploys and traffic management. They want health checks, connection draining, and the reason a deploy can drop requests even when nothing crashed.
A real interview question
What does a load balancer do during a deployment, and how does it know an instance is ready?
What most people say
drag me
“It splits traffic between servers so no single one is overloaded.”
True but it answers a different question. The question is about deployment, and the interesting behaviour is health checking and connection draining, neither of which appears here.
The follow-ups they ask next
What does the application need to do on shutdown?
Catch SIGTERM, stop accepting new requests, finish in-flight ones, then exit before the kill timeout. In Kubernetes a preStop hook plus the right termination grace period covers the endpoint removal race.
How is a layer 4 balancer different from layer 7?
L4 routes on IP and port without seeing the request, so it is faster and protocol-agnostic. L7 reads HTTP, so it can route by path or header, terminate TLS, and retry idempotent requests.
What the interviewer is listening for
- Names health checks and draining
- Explains how a lying health check drops requests
- Knows the app must handle SIGTERM
What sinks the answer
- Only describes traffic splitting
- Unaware of draining
- Thinks a running process means a ready one
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.
“It [sends traffic only to targets passing health checks] and [drains connections on removal so in-flight requests finish]. Deploys drop requests when [the health check passes before the app is really ready] or [instances are removed without draining]. The app must [handle SIGTERM and finish current work].”
Keep going with networking
Mid
Trace what happens between a user typing your URL and your container returning a response.
Senior
A service starts refusing connections under load, but CPU and memory are fine. What limits would you check?
Junior
Design the pipeline for a typical web application. What stages would you have, and in what order?
Junior
Our Docker image is 1.2 GB and takes 8 minutes to build. How would you make it smaller and faster?
Junior
Explain the relationship between a Pod, a Deployment, and a Service in Kubernetes.
Junior
What is Terraform state, why does it exist, and what goes wrong if two people apply at the same time?
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