Pregunta de entrevista de Capgemini

Code about a pattern to write in java