Uber - Software Engineer (Frontend) - DS&A

Level: L4
Education: BS in CS
Years of Experience: 10
Questions Asked:
We have different sequences API calls. It could be
A
AA => AB =>AC
ACA => ACB
ACAA => ACAB
If given a node from such a tree structure, can you print out the node’s children and all the parent nodes until the root?
It needs to use breadth first search + recursion.