← Adobe questions

Find longest distance between two nodes in a tree

Filed under Adobe

Given the root of a binary tree, calculate the length of its diameter. The diameter of a binary tree is the length of the longest path between any two nodes in the tree. This path may or may not pass…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Adobe questions

Collected from public candidate posts and coding forums. Updated Nov 2026.