Microsoft Interview Question

Write a program for circular Q