Design a load balancer that distributes incoming traffic across a fleet of application servers for a high-traffic web application handling 200,000 requests per second. The load balancer must support health checking, multiple balancing algorithms, session persistence (sticky sessions), graceful server draining, and SSL termination.
In your 90-second answer, cover: - L4 vs. L7 load balancing: when to use each and the tradeoffs - Load balancing algorithms: round-robin, least connections, weighted, consistent hashing - Health checking: how to detect and remove unhealthy servers - Session persistence: how to route a user to the same backend consistently
Constraints: failover to a healthy server must happen within 5 seconds of a backend failure. Adding or removing servers must not drop existing connections.
How to approach it
- Hint 1
L4 (transport layer) load balancers work at the TCP level -- they are fast but cannot inspect HTTP content. L7 (application layer) load balancers can route based on URL path, headers, or cookies -- more flexible but more overhead.
- Hint 2
For session persistence without server-side state, consider hashing a client identifier (IP, cookie, or header) to consistently map to the same backend. Consistent hashing minimizes remapping when servers are added or removed.
- Hint 3
Graceful draining means stopping new connections to a server while allowing existing connections to complete. This requires the load balancer to distinguish between new and existing connections.
Ready to answer it out loud?
Record your answer in 1:30 and Preptile scores it 1–10 with specifics — what landed, what you skipped, and what to say next time.
Practising needs an invite code. Join the waitlist and we’ll send you one.