Apple interview question

Asked me to refactor code on the screen