EPAM Systems interview question

Short programs involving collection traversals