Pergunta de entrevista da empresa GRAPHISOFT

Find the bugs in the code How would you refactor it