Apple interview question

write recursive functions