How does a load balancer distribute traffic, and what algorithms are common?
Reviewed by Gurusankar M.
Short Answer
A load balancer spreads requests across healthy backends and removes failed ones via health checks. Common algorithms: round-robin, least-connections, and consistent-hashing (sticky by key). L4 balances by TCP/IP (fast), L7 by HTTP content (path/host routing).
On this page
Concept Made Simple
Coffee Chat Question
“How does a load balancer distribute traffic, and what algorithms are common?”
Remember It Faster
Mind Map Answer
- Round-robin
- even rotation
- Least-connections
- to the least-busy backend
- Hash/sticky
- same client/key → same backend
- L4 vs L7
- TCP fast / HTTP content routing
Think Beyond the Expected
What If?
Why are health checks essential to a load balancer?
Without them the LB keeps sending traffic to dead/unhealthy instances, so users get errors. Health checks let the LB detect failures and route only to healthy targets — the core of self-healing and zero-downtime deploys.
Real World
L7 load balancers (ALB/Nginx) do path/host routing and TLS termination; least-connections suits uneven request costs. Health checks + connection draining make deploys and failures invisible to users.
Interviewer's Expectation
Keywords they're listening for:
- distribute + health check
- round-robin/least-conn/hash
- L4 vs L7
- sticky sessions trade-off
- removes unhealthy
Common Mistakes
- No/weak health checks
- Sticky sessions defeating even distribution
- Single LB as a SPOF
Best Practices
- Health checks + connection draining
- Pick the algorithm to match request cost
- Run the LB redundantly
Follow-up Questions
- When do you need sticky sessions (and why avoid them)?
- L4 vs L7 — trade-offs?
- How does the LB itself avoid being a SPOF?
Continue Learning with AI
Take this question deeper with your favourite AI assistant. Pick a depth, copy the prompt, or open it directly — AI is your learning companion, not a shortcut.
Plain-language foundations
I'm preparing for a software engineering interview and want to understand this from scratch, as a beginner. Topic: Load Balancing (System Design) Interview question: "How does a load balancer distribute traffic, and what algorithms are common?" Please: 1. Explain the core idea in simple, plain language, using an everyday analogy. 2. Define any technical terms you use. 3. Walk through one small, concrete example. 4. Finish with a single sentence I can easily remember. Keep the tone friendly and assume I'm new to this topic.
Was this answer helpful?
Affiliate links
Tools for Your Developer Workspace
Equipment for a comfortable, productive setup.
As an Amazon Associate I earn from qualifying purchases.
- MonitorView on Amazon : BenQ EW2790U 27-inch Monitor (opens in a new tab)
BenQ EW2790U 27-inch Monitor
- LaptopView on Amazon : Acer Aspire One Laptop (opens in a new tab)
Acer Aspire One Laptop
- Office ChairView on Amazon : Wakefit Gravita Ergonomic Office Chair (opens in a new tab)
Wakefit Gravita Ergonomic Office Chair