12. Interview Framing
The questions that actually get asked, and the sharpest honest answer to each
Q: What's the actual difference between a load balancer and an API gateway?
A load balancer decides which server; an API gateway decides what should even happen to the request - auth, rate limiting, routing to the right service, sometimes combining several services into one response - often before a load balancer's question is even asked.
Q: How do you make the load balancer itself highly available?
Don't run just one. Use an active-passive pair with a floating/virtual IP that fails over automatically, or DNS-based failover across multiple LB endpoints. A single load balancer without its own redundancy is still a single point of failure - you've just moved it.
Q: When would you choose a service mesh over a centralized API gateway?
When most of the traffic is service-to-service, internal, and high-volume - a central gateway becomes a bottleneck and a shared point of failure for that traffic. A mesh distributes routing and retries to a sidecar next to every service instead, at the cost of real operational complexity.
Q: What happens when a recovering server gets slammed right after coming back online?
Thundering herd on recovery - the load balancer treats it as instantly healthy and sends a full share of traffic before caches or connection pools are warm. The fix is a slow-start ramp: gradually increasing the share of traffic a recovered server receives instead of switching it on at 100%.
Q: Why can sticky sessions be a problem?
Pinning a client to one server for session state quietly reintroduces the stateful-server problem - that server becomes special, harder to scale horizontally, and a bigger deal to lose. The more robust fix is usually externalizing session state to a shared store, so any server can serve any request.