Amazon Interview Question

Graph algorithms and random paths