Google Interview Question

A question which requires basic understanding of functions and loops to solve.