← Questions

Validate a hierarchy and compute how long a message takes to spread

0
MicrosoftCodingLast asked Sep 2026

A coding interview question asked in Microsoft's technical phone screen, last asked Sep 2026. It tests trees, graphs and bfs.

A company has n employees with IDs 0 to n - 1. manager[i] is the direct manager of employee i, and -1 marks the head of the company. When a manager gets a message, they need inform_time[i] minutes to pass it to all of their direct…

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

What it tests

trees · graphs · bfs

Your code and the AI tutor open when you unlock this question.