Uber interview question

Based on graphs and data structures