EPAM Systems interview question

System design and sudo code