UCLA interview question

Some basic algorithms