Two Sigma interview question

Basic graph theory (BFS, DFS) and dynamical programming.