EG Group interview question

Problem solving