Pregunta de entrevista de Capgemini

For a formality, he asked me to write a program for printing a pattern