← Back to the queues page
Circular / Bounded Queue
A fixed-capacity FIFO over a ring buffer. Memory never grows — old data is either rejected or overwritten by policy.
What to know
- Backpressure: a full queue signals producers to slow down.
- Single-producer single-consumer rings can be lock-free.
- Choice on overflow: block, drop-new, or overwrite-oldest.
In the wild: Kernel network buffers, audio pipelines, IoT telemetry buffers, Disruptor pattern in trading.
Algorithms to reach for
Ring-buffer enqueue/dequeue
O(1)Constant-memory O(1) queue ops
Producer-consumer coordination
O(1) per itemDecouple fast producers from slow consumers
Practice problems — with full guides
Each problem has its own page: progressive hints, how to approach it, and the full solution.