Amazon interview question

Graph algorithms and random paths