Postman Interview Question

You had to use recursion in coding round.