Pergunta de entrevista da empresa Uber

I received a dynamic programming problem and a DFS problem.