Motive | Senior Software Engineer(L5) | Coding | Phone Screen

albinantonyalbinantony·
Interview Date:January 12, 2026Region:UnspecifiedHiring Team/Org:General Hire

You are given the root of a binary tree and an integer distance. A pair of leaf nodes is considered good if the number of edges in the shortest path between them is less than or equal to distance. Return the number of good leaf node pairs in the tree. 1 / \ 2 3 / / \ 4 5 6 Details Leaf nodes: 4, 5, 6 Distance definition: number of edges Example distance: dist(4,5) = 4 → 2 → 1 → 3 → 5 = 3 edges follow up: You are give...

Sign in to view the full interview experience

Create or use your InterviewDB account to read the full Warren post and all shared details.

Sign in to continue
0

Discussion

0

Log in to post a comment or vote.

Sort by
Loading comments...

Interview Resources

InterviewDB

About InterviewDB

Crowdsourced Interview Question Bank for Job Seekers in Tech/Finance Industry

Copyright © 2026 InterviewDB. Victory is reserved for those who are willing to pay its price.