Pergunta de entrevista da empresa EPAM Systems

Technical questions and simple algorithmic task, was need to describe solution