Pergunta de entrevista da empresa IBM

Complicated design that I worked