Apple interview question

mathematical riddles, stacks, linked list