Google Interview Question

graph problem, and a problem with binary search solution.