Uber interview question

One graph problem and a greedy problem