EPAM Systems interview question

Graphs