Pregunta de entrevista de IBM

Complicated design that I worked