Microsoft interview question

Write a program for circular Q