Store a hierarchy and return all children | Atlassian Interview Question