Addepar interview question

DSA question - need to create a recursively tree type structure.