Niantic interview question

n-ary tree question (data structures and algorithms)