Microsoft interview question

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