Mazak interview question

A question on graph traversal.