Apple interview question

Here is a code, find bugs in it