Apple interview question

Difficult