DataVisor interview question

some graph traversal problem