Axe Group interview question

Just some code was given to review