CodingReported in a candidate post, Aug 2024
Find k-th ancestor of a node in a binary tree
Filed under PhonePe
The question
Given a binary tree, find the k-th ancestor of a specific node, returning -1 if it does not exist.
No write-up yet. Related questions below have one.
Related PhonePe questions
Collected from public candidate posts and coding forums. Updated Nov 2026.