Design read-heavy org chart subordinate counts

Quick Overview

Evaluates understanding of tree/graph data modeling, dynamic indexing, and consistency and concurrency control for maintaining aggregate subordinate counts under updates; Category/Domain: System Design.

Design read-heavy org chart subordinate counts

Company: Microsoft

Role: Software Engineer

Category: System Design

Difficulty: medium

Interview Round: Onsite

You are given manager→direct-report relationships for an organization (an employee has at most one direct manager; the top-level employee has none). Build a data structure/service that supports: 1) **Query (read-heavy):** given an employee id, return how many total people are in their reporting chain below them (all direct and indirect reports). 2) **Update:** a relationship can change (e.g., employee X moves from manager A to manager B). After an update, future queries must return correct counts. Discuss the data model, algorithms, and how you would keep queries fast while handling updates safely (e.g., avoiding cycles).

Quick Answer: Evaluates understanding of tree/graph data modeling, dynamic indexing, and consistency and concurrency control for maintaining aggregate subordinate counts under updates; Category/Domain: System Design.

|Home/System Design/Microsoft
Microsoft logo
Microsoft
Feb 7, 2026, 12:00 AM
mediumSoftware EngineerOnsiteSystem Design
10
0

You are given manager→direct-report relationships for an organization (an employee has at most one direct manager; the top-level employee has none). Build a data structure/service that supports:

  1. Query (read-heavy): given an employee id, return how many total people are in their reporting chain below them (all direct and indirect reports).
  2. Update: a relationship can change (e.g., employee X moves from manager A to manager B). After an update, future queries must return correct counts.

Discuss the data model, algorithms, and how you would keep queries fast while handling updates safely (e.g., avoiding cycles).

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...