Do Two Individuals Share a Common Ancestor?
Asked at Google · Coding Questions · Difficulty: Easy
Given a family tree stored as a parent map, decide whether two individuals are related, meaning that they have at least one common ancestor.
Loading the problem…
More Google interview questions
- LLM conceptual questions
- Implement a Nested Tic-Tac-Toe Game Engine
- ML Fundamentals Deep Dive (AI/ML & MLE Roles)
- ML System Design: Recsys, Chatbot, Image Classifier
- Implement Scaled Dot-Product Attention
- Meeting Rooms: Minimum Rooms to Hold All Meetings