Postman interview question

You had to use recursion in coding round.