IMC·Software Engineer·Online Assessment (OA)
- Given an employee hierarchy represented as a tree or forest, implement a system to answer queries such as: find the manager chain for an employee, find the lowest common manager of two employees, and compute the total number of reports under a given manager. Discuss your build and query time and space complexity.
“I went with DFS and precomputed parent pointers plus subtree sizes during the build phase, which felt right.”