PART 2 / LESSON 10 · Overview free · interactive lesson in the full course

Ring buffers, queues and stacks in C

Study fixed-capacity FIFO storage, wraparound and the assumptions behind single-producer/single-consumer designs.

View lesson accessAll lessons

What the lesson covers

The course lesson is called The UART that drops bytes. A UART interrupt delivers bytes in bursts of four. The main loop reads one at a time, and a single shared variable loses most of every burst.

Before you start

Question to think about: How will the design distinguish an empty queue from a full queue?

Preparation exercise: Define capacity and overflow behavior before testing sequential operations; state separately what concurrency assumptions are required.

This is an original public study prompt, not the paid lesson or its solution. The interactive course contains the walkthroughs, labs, exercises and recaps.

Related free reading

Test your understanding

Practice free firmware interview questions and mock interviews · Assess your readiness