Google interview question

graph problem, and a problem with binary search solution.