EGYM interview question

C++, coding exercises, code review