Subtracks & Tasks
Layer 4 Load Balancing
Implement Round Robin Load Balancer
Implement round robin load balancing: 1. Maintain an ordered list of backend servers 2. Track current server index 3. For each request, send to serve...
Implement Least Connections Algorithm
Implement least-connections load balancing: 1. Track active connection count for each server 2. When a request starts, increment count for chosen ser...
Add Health Checks and Failover
Add health checking to your load balancer: 1. Periodically send health check requests to servers 2. Track consecutive failures per server 3. Mark ser...
Build Layer 7 Load Balancer
Build an HTTP-aware (Layer 7) load balancer: 1. Parse HTTP request (method, path, headers) 2. Route based on Host header (virtual hosts) 3. Route bas...
Implement Consistent Hashing for Load Balancing
Implement consistent hashing for stateful load balancing: 1. Assign servers to positions on hash ring 2. Hash each request key to ring position 3. Ro...
Layer 7 Load Balancing
Implement Layer 7 HTTP Proxy
Layer 7 load balancing operates at the HTTP application layer, inspecting headers and URL paths to make routing decisions. Unlike Layer 4 (TCP), L7 pr...
Implement Path-Based Routing
Path-based routing directs requests to different backend pools based on the URL path. This enables microservices architecture where /api/* routes to A...
Implement Sticky Sessions
Sticky sessions (session affinity) ensure that all requests from a client are routed to the same backend server, essential for stateful services. **W...
Implement Circuit Breaking
**Circuit states**:. ```. CLOSED (normal). - Requests pass through to backend. - Track failures in a sliding window. - If failures > threshold → OPEN....
Implement Rate Limiting
Rate limiting protects backend services from being overwhelmed by too many requests. It prevents abuse, ensures fair usage, and maintains service avai...
Advanced Balancing Algorithms
Implement Least-Connections Load Balancing
Least-connections load balancing routes each request to the backend with the fewest active connections. This is superior to round-robin when request d...
Implement Weighted Round-Robin Load Balancing
**Why weighted round-robin?**. ```. Problem: backends have different capacities. backend-1: 8 cores, 32GB RAM (high capacity). backend-2: 8 cores, 32G...
Implement Power-of-Two-Choices Load Balancing
Power-of-two-choices is a randomized load balancing algorithm that approximates least-connections with constant-time selection. Instead of checking al...
Implement Consistent Hashing for Load Balancing
Consistent hashing for load balancing ensures that the same client always routes to the same backend. This is useful for caching layers where session ...
Simulate Thundering Herd with Circuit Breaking
The thundering herd problem occurs when a large number of clients simultaneously retry after a backend failure, overwhelming the remaining backends an...
Interview Prep
Common interview questions for Infrastructure / Platform Engineer roles that map directly to what you build in this track. Click any question to reveal the model answer.
Questions are representative of real interview patterns. Model answers are starting points — adapt them with your own experience and the specific context of the interview.
Common Mistakes
The top 5 mistakes builders make in this track — and exactly how to fix them. Click any mistake to see the root cause and the correct approach.
Comparison Mode
Side-by-side comparisons of the approaches, algorithms, and trade-offs you encounter in this track. Expand any comparison to see a detailed breakdown.
Concepts Covered
Prerequisites
It is recommended to complete the previous tracks before starting this one. Concepts build progressively throughout the curriculum.
Rabbit Holes
For when you want to go deeper. Curated papers, posts, and talks beyond what this track covers.
Load Balancing at Scale (Facebook Engineering)
How Facebook built a three-layer load balancing system: DNS, L4, and L7. The distinction between these layers and why you need all three at Facebook's scale is the conceptual foundation for modern load balancing.
The Power of Two Choices in Randomized Load Balancing
Mitzenmacher's PhD thesis on the "power of two random choices" — picking two random backends and routing to the less loaded one. This simple trick outperforms pure random assignment and is the basis for modern load balancers.
NGINX Upstream Load Balancing Algorithms
A practical comparison of round-robin, least connections, IP hash, and least time algorithms in NGINX. The documentation explains when each one is appropriate and the operational implications of each choice.
HAProxy Configuration Guide
HAProxy's configuration documentation reveals the full operational complexity of production load balancing: health check intervals, slow-start, session stickiness, and connection draining. This is what "done" looks like in production.