EPAM Systems Interview Question

Find problems in a presented code sample and try to refactor it