Marvell Technology interview question

Coding for a ring buffer.