Pregunta de entrevista de Thoughtworks

How to refactor common code into a base class.