A JavaScript problem to solve before interviews.
- Clone the repo.
- Open
index.htmlin your browser. - Open
js/Person.js,js\PersonTreeNode.js, andjs/answer.jsin your favorite editor. - Add your code to the
generateTreefunction inanswer.js.
- The test uses two JavaScript classes
PersonandPersonTreeNode. - The
generateTreefunction recieves a list ofPersonobjects and should return the rootPersonTreeNode(the ceo). - Each
PersonTreeNode'sdirectReportsarray should contain aPersonTreeNodefor each direct report of that person (someone who reports directly for you, i.e. you are their manager). - The app will use your
generateTreefunction to see if passes the test. - Refresh the page or click the button to rerun the test.