This is a coding project I completed as part of an interview process. The coding project tested knowledge of Node.js, recursion, file I/O, and most importantly, creating dependency trees.
The objective of the project was the following:
- Read an input file (
org_chart_sample.in), a CSV-like file with data about an imaginary organization's employees.
- Parse the input, given a predefined pattern:
- line 1 has the number of rows (test cases) to expect
- Each test case has employees (name, supervisor name, Title, Year started), separated by "--"
- Create a dependency tree starting with CEO, and write file to disk (
- final.js - The code
- org_chart_sample.in - Given input data
- org_chart_sample.out - Output generated by
$ node ./final.js
org_chart_sample.out will be overwritten.