Two Sigma Interview Question

One graph and one recursive backtracking problem