UBC interview question

Fairly standard