EPAM Systems interview question

Coding questions n logical output