Microsoft interview question

Write get and put functions for a circular buffer.