C3 AI interview question

I was presented with a recursive programming question.