Apple interview question

Not difficult or anything unexpected