Load Balancing and Traffic Management Questions

Distributing requests across capacity: load-balancing algorithms (round-robin, least-connections, consistent hashing), L4 versus L7 balancing, health checks, and traffic shaping. Covers sticky sessions, canary and blue-green routing, rate limiting, and graceful draining. The traffic-distribution layer that keeps a scaled system balanced and available.

MediumTechnical
46 practiced

Implement a thread-safe least-connections scheduler. Provide addBackend(id), removeBackend(id), incConn(id), decConn(id), and selectBackend(), where selectBackend() returns the backend with the fewest active connections and ties are broken deterministically. Describe your concurrency strategy, its complexity, and how you would handle backends with very different capacities so the busiest small backend isn't starved.

HardSystem Design
47 practiced

Design a Layer 7 load balancer that provides session affinity using consistent hashing on a session cookie. It must support health checks and rebalance sessions gracefully when nodes are added or removed. Discuss hash ring maintenance, virtual nodes, and how you would drain and migrate sessions without dropping in-flight traffic.

MediumTechnical
36 practiced

How does weighted round robin differ from applying weights to least-connections? Sketch how you would distribute requests proportional to backend weight under each approach, and describe when you would adjust weights dynamically, for example during autoscaling or when an instance is degraded.

EasyTechnical
37 practiced

Describe DNS-based load balancing strategies: round-robin DNS, weighted DNS, and GeoDNS. What are their pros and cons for global traffic distribution, and how do DNS TTL and resolver caching affect failover speed and consistency? How would you design TTLs for fast failover without overloading your authoritative nameservers?

HardSystem Design
38 practiced

Compare the architectural implications of an external load balancer versus a sidecar-based service mesh (for example Envoy) for intra-cluster traffic. For a large microservices environment, discuss trade-offs in routing flexibility, observability, latency overhead, and operational complexity, and how traffic distribution patterns change when you introduce a mesh.

Unlock Full Question Bank

Get access to all Load Balancing and Traffic Management interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.