Microsoft interview question

Algorithm of duck-duck-goose