Google interview question

Software Engineering Puzzle