Apple interview question

Implement a circular buffer in C