Try
↑ ↓ move↵ openesc close

Interview prep / Load shedding and backpressure

Junior · Load shedding and backpressure · System design interview question

What is load shedding, and why is rejecting a request early better than queueing it?

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

A strong answer

Load shedding means refusing or dropping some requests on purpose when demand is above capacity, so that the ones you accept still finish in time.

A queue turns excess load into delay. Each request waits behind all the ones before it, and past a point the wait is longer than the caller is willing to stay. The server then spends its time finishing requests that nobody is waiting for. It is busy and useful to no one.

Rejecting early does three things. The caller learns at once and can back off or try elsewhere. The server spends almost nothing on the rejected request. And the requests it did accept are not delayed by a long queue.

What gets shed is a policy choice: the newest requests, the least important ones, or those that can no longer meet their deadline. Shedding does not create capacity. It only chooses how gracefully you fail.

Sources

Learn it by running it

The load shedding and backpressure 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