Thoughtworks interview question

Problem solving