InterviewDigestInterviewDigest

OA Practice Workspace

Technical2026-08-13

Given record of employee and mgr in map, print employees in a hierarchical manner

AI-Expanded — inferred from the question title, not from the original candidate report

Given a map where each key represents an employee ID and the corresponding value is their manager's ID, construct and print a hierarchical representation of the organization. Your solution should output the structure in a readable format, such as an indented tree or nested list, that clearly illustrates the reporting relationships starting from the top-level manager.

Context & Summary

Personal Interview Round 2

💻 Coding practice works best on desktop.
Code editors are too cramped on mobile screens.