Intuting
  • Untitled
  • Algorithm Interviews
    • Common Manager
    • Least # of Activities
    • Real Estate Agent
    • Palindrome Pairs
    • Mirror Tree
    • Ship Cargo in 5 Days
  • Coding Interviews
    • Linux "Find" Command
    • Amazon Locker Service
    • Cache Analysis Service
    • Zookeeper Service
  • System Design Interviews
    • Event Reservation System
Powered by GitBook
On this page
  • Question
  • Solution

Was this helpful?

  1. Algorithm Interviews

Common Manager

#Amazon #Medium #Coding

PreviousUntitledNextLeast # of Activities

Last updated 5 years ago

Was this helpful?

Question

Given a list of employees, find the common manager of two people.

Solution

This is really similar to the "lowest common ancestor in a binary tree" problem except it has more than 2 children per node.

Lowest Common Ancestor in a Binary Tree | Set 1 - GeeksforGeeksGeeksforGeeks
Logo