Motive | Senior Software Engineer(L5) | Coding | Phone Screen
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 continue0