Microsoft Interview Question

Algorithm of duck-duck-goose