Apple interview question

based on oops, dbms , sql and some general questions