Nextdoor Interview Question

given comment(id, parentid) nodes, print out the comment.