0
0
HLDsystem_design~20 mins

Load balancing algorithms (round robin, least connections) in HLD - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Load Balancing Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
How does the round robin load balancing algorithm distribute requests?

Imagine you have 4 servers and a load balancer using the round robin algorithm. How does it assign incoming requests?

AIt sends each new request to the next server in order, cycling back to the first after the last.
BIt sends all requests to the server with the fewest active connections.
CIt sends requests randomly to any server without order.
DIt sends requests only to the server with the highest CPU usage.
Attempts:
2 left
💡 Hint

Think about a simple way to share requests evenly without checking server load.

Architecture
intermediate
1:30remaining
Which load balancing algorithm is best when servers have uneven workloads?

You have 3 servers with different current loads. Which algorithm helps distribute new requests to the least busy server?

ARound robin, because it cycles evenly through servers.
BRandom, because it picks any server without checking load.
CIP hash, because it sends requests based on client IP.
DLeast connections, because it sends requests to the server with the fewest active connections.
Attempts:
2 left
💡 Hint

Consider which algorithm checks server load before assigning requests.

scaling
advanced
2:00remaining
What is a key limitation of round robin load balancing in a system with servers of different capacities?

Consider a system with 2 servers: one powerful and one weaker. What problem can round robin cause?

AIt causes requests to be dropped randomly.
BIt may overload the weaker server by sending equal requests to both servers regardless of capacity.
CIt requires servers to share session state.
DIt always sends requests to the most powerful server only.
Attempts:
2 left
💡 Hint

Think about how equal distribution affects servers with different power.

tradeoff
advanced
2:00remaining
What is a tradeoff when using least connections load balancing compared to round robin?

Least connections balances load better but has a cost. What is a downside compared to round robin?

AIt requires tracking active connections on each server, increasing complexity and overhead.
BIt always sends requests to the same server, causing imbalance.
CIt cannot handle more than 2 servers.
DIt ignores server health status.
Attempts:
2 left
💡 Hint

Think about what extra information least connections needs to work.

estimation
expert
2:30remaining
Estimate the maximum number of concurrent connections a load balancer can handle using least connections algorithm with 5 servers, each supporting 1000 connections.

Assuming the load balancer perfectly distributes connections using least connections algorithm, what is the maximum total concurrent connections supported?

A1000 connections, limited by the weakest server.
B2000 connections, assuming half the servers are used at a time.
C5000 connections, as it sums the capacity of all servers.
D10000 connections, doubling the total server capacity.
Attempts:
2 left
💡 Hint

Think about how least connections distributes load across all servers.