EPAM Systems interview question

logical tasks and check for analytical thinking