Intersection of Two Family Chains
Asked at Google · Coding Questions · Difficulty: Easy
Each node has a `parent` pointer. A "chain" is the singly linked path obtained by repeatedly following `parent` from a node up to the root. Given two starting nodes, find the first common node where their two chains intersect (their lowest common ancestor along the parent chain), or `None` if they never meet.
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)
- Design a Real-Time Product Recommendation System
- Implement Scaled Dot-Product Attention
- Design a Multi-Tenant, Multi-Region API Rate Limiter