NADSOFT interview question

Recursive function