BT Group interview question

Design pattern, problem solving