Pregunta de entrevista de Microsoft

How does a rotary buffer work? Implement it in C.