Pregunta de entrevista de Graphcore

(white boarding question) Implement a circular buffer algorithm on the whiteboard and explain your though process.