Uber coding interview with a tree rerooting problem that looks manageable until you actually try to implement it cleanly under pressure. The key gotcha is recursion depth on large inputs, which I did not see coming.
“I got the basic idea pretty quick: root the tree at node 0, count reversals needed, then reroot by adjusting the count as you move the root along each edge.” The rest of the author's notes on Software Engineer interview at Uber, Technical Phone Screen round, covers how they worked through the question, what the panel pushed back on, and what they would do differently.