Uber interview question

Q: Tree, Sorting, & Graph Questions