Try
↑ ↓ move↵ openesc close

Interview prep / Queues as buffers

Mid · Queues as buffers · System design interview question

Producers send 20 percent more than the consumers can process. A teammate proposes making the queue ten times bigger. What do you say?

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

A strong answer

It will not raise throughput. The consumers still finish the same number of messages per second, so the excess is lost or held back as before, only later.

What changes is the wait. A full queue holds about its capacity and drains at a fixed rate, so ten times the buffer means roughly ten times the delay. Messages that have waited that long may no longer be useful.

Better proposals are more consumers, cheaper work, or shedding load at the edge. A bigger buffer is right in one case only: a burst longer than today's buffer, with average load below capacity.

Sources

Learn it by running it

The queues as buffers 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