# First Common Ancestor of Two Nodes in a Binary Tree | Aced

Aced (formerly Exponent) publishes a public search API over its indexed pages; the guide is at https://www.aced.io/agents/agent-access.

Source: https://www.aced.io/questions/4538/binary-tree-first-common-ancestor
Source observed: 2026-11-04T22:03:14.233Z
Last checked: 2026-11-04T22:03:14.233+00:00
Indexed: 2026-11-05T07:51:26.48+00:00

---

# Find the first common ancestor of two nodes in a binary tree

We provide this Aced (formerly Exponent) question as part of our interview-preparation library. It is classified under **Data Structures & Algorithms** and **Coding**, and is associated with the **Machine Learning Engineer** role and **Meta**.

## Question details

- **Reported interviews:** 2
- **Reported last asked:** 10 months ago
- **Community answers:** None contributed yet
- **Actions:** Users can mark that they were asked this question, save it, and submit an answer. Submitting marks the question complete.

Detailed company statistics require an upgrade: [Upgrade](https://www.aced.io/upgrade?src=questions).

## Interview experience

We have **1 shared interview experience** associated with this question:

- [Meta · 10 months ago](https://www.aced.io/experiences/meta-facebook-senior-machine-learning-engineer-interview-16fb62) — A candidate interviewed for **Software Engineer, Machine Learning at the L5 level**. The process included a recruiter screen, an online coding assessment, one live coding round, a second recruiter debrief call, and a final virtual onsite with three coding interviews, one behavioral interview, and one system design interview. The coding rounds were described as mostly classic algorithm questions. The system-design topic was a recommendation system for ranking locations in a feed for someone visiting a new city. The candidate felt the interviewers graded more leniently than the candidate would have graded themself.
  - Role: **Machine Learning Engineer · Senior / L5**

## Related questions

- [Find the lowest common ancestor (LCA) of two nodes in a binary tree.](https://www.aced.io/questions/1156/lowest-common-ancestor-binary-tree)
- [Find the common ancestors in a tree.](https://www.aced.io/questions/3443/find-common-ancestors-tree)
- [Print the top view of nodes in a binary tree.](https://www.aced.io/questions/5570/top-view-nodes-binary-tree)

## Related courses

### [Machine Learning Engineer Interview Prep](https://www.aced.io/courses/ml-engineer)

![Machine Learning Engineer Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/6UfkHxUyLQVfDHSfLNQtWa/1be1539a65b4f6f15201f5b573c0a578/ML_Engineer_Interview_Prep_Course.jpeg?w=800&h=800&fm=webp&q=75)

We help candidates prepare for machine-learning roles at Meta, Google, Amazon, Apple, Microsoft, Nvidia, and other top companies through mock interviews, frameworks, and advice from senior candidates. Topics include ML system design, core concepts, coding, behavioral interviews, and more.

### [Behavioral Interviews: A Practical Guide for Engineers](https://www.aced.io/courses/eng-behavioral)

![Behavioral Interviews: A Practical Guide for Engineers](https://images.ctfassets.net/x78yjrjc11pq/47qcoHjzFZXE37GoacedkB/9d8e3f4910d8b06b21e76745cd9cbff3/AdobeStock_1142146335.jpeg?w=800&h=800&fm=webp&q=75)

We help engineers prepare for senior-plus behavioral interviews at FAANG and Tier-1 companies. The course was made with staff and principal engineers from Meta, Netflix, Google, and more, and focuses on avoiding down-leveling, elevating past projects, and giving natural answers.

## Navigation and account links

- [All Questions](https://www.aced.io/questions)
- [Aced home](https://www.aced.io/?src=nav)
- [Browse all questions](https://www.aced.io/questions?src=nav)
- [Practice](https://www.aced.io/practice?src=nav)
- [Mock Interviews & Coaching](https://www.aced.io/coaching?category=mock_interviews&src=nav)
- [Resume Review](https://www.aced.io/resume?src=nav)
- [Salary Negotiation](https://www.aced.io/coaching?category=negotiation&src=nav)
- [Pricing](https://www.aced.io/upgrade?src=nav)
- [Sign up](https://www.aced.io/signup?src=nav)
- [Log in](https://www.aced.io/login?src=nav)

## Interview-preparation categories

- [Product Management](https://www.aced.io/courses/pm?src=nav)
- [Forward Deployed Engineering](https://www.aced.io/courses/forward-deployed-engineering?src=nav)
- [Engineering Management](https://www.aced.io/courses/engineering-management?src=nav)
- [Software Engineering](https://www.aced.io/courses/software-engineering?src=nav)
- [System Design](https://www.aced.io/courses/system-design-interviews?src=nav)
- [Data Science](https://www.aced.io/courses/data-science?src=nav)
- [Machine Learning](https://www.aced.io/courses/ml-engineer?src=nav)
- [Data Engineering](https://www.aced.io/courses/data-engineering?src=nav)
- [View all courses](https://www.aced.io/courses?src=nav)
- [Loops](https://www.aced.io/guides?src=nav)
- [Experiences](https://www.aced.io/experiences?src=nav)
- [Behavioral Questions](https://www.aced.io/questions?type=behavioral&src=nav)
- [Coding Questions](https://www.aced.io/questions?type=algorithms&filterBy=codeEditor&src=nav)
- [System Design Questions](https://www.aced.io/questions?type=system-design&src=nav)
- [SQL Questions](https://www.aced.io/questions?type=sql&filterBy=codeEditor&src=nav)
- [Machine Learning Questions](https://www.aced.io/questions?role=ml-engineer&type=machine-learning&type=concept&src=nav)
- [Investment Banking Questions](https://www.aced.io/questions?role=investment-banking&src=nav)
- [Data Engineering Questions](https://www.aced.io/questions?role=data-engineer&type=data-pipeline-design&type=system-design&type=sql&type=data-modeling&src=nav)

## Additional services and resources

- [Job Referrals](https://www.aced.io/jobs/referrals?src=nav)
- [Blog](https://www.aced.io/blog?src=nav)
- [Resources](https://www.aced.io/resources?src=nav)
- [Work with us](https://www.aced.io/collaborate?src=nav)
- [Perks](https://www.aced.io/perks?src=nav)
- [For universities](https://www.aced.io/pages/university?src=nav)
- [For businesses](https://www.aced.io/pages/business?src=nav)
- [For recruiters](https://www.aced.io/jobs/post?src=nav)
- [Affiliate program](https://www.aced.io/affiliate?src=nav)

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F4538%2Fbinary-tree-first-common-ancestor&trace=t_679ff9ab98f3)

## Ask a follow-up about this page

Need a more specific answer? Ask the exact question you have. It returns a fresh, cited answer from Aced (formerly Exponent)’s knowledge base. No account or API key required.

Open this URL with your own question, URL-encoded. Include your question in q. All research inputs are optional; no account or setup.

`GET https://www.aced.io/agents/agent/faq?q={question}&trace=t_679ff9ab98f3`

[Tool guide and examples](https://www.aced.io/agents/agent-access) · [OpenAPI](https://www.aced.io/agents/api/public/v1/openapi.json) · [Page TLDR form](https://www.aced.io/agents/agent-tools/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F4538%2Fbinary-tree-first-common-ancestor). Opening a form does not execute a tool.