Uber interview question

Node traversal in a cyclic graph.