Try
↑ ↓ move↵ openesc close

Interview prep / Load balancing

Junior · Load balancing · System design interview question

What is the difference between round robin and random load balancing, and when does round robin fall short?

Sketch your own answer first, then compare it with the one below.

A strong answer

Round robin sends request after request to the next server in a fixed order. Random picks a server uniformly for each request. Neither looks at how busy a server is.

Round robin gives every server the same number of requests, which is more even than random over short windows. Random can send several requests in a row to the same server by chance.

Round robin falls short when equal request counts are not equal work. If requests differ in cost, or servers differ in speed, one server accumulates a queue while another idles. It also has no way to react when a server slows down or fails, unless health checks remove it from the rotation.

Round robin ignores current queue length, request cost, and server speed. That is why the usual next step is a strategy that looks at queues, such as least connections or power of two choices.

Sources

Learn it by running it

The load balancing lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms