Google interview question

probability and graph with depth first search.