Search
⌘K
Leetcode 543. Diameter of Binary Tree
Given the root of a binary tree, return the diameter — the maximum number of edges on any path between two nodes; the core challenge is to compute subtree heights and track the maximum sum of left and right heights at each node in a single O(n) traversal.
Asked at:
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Early April, 2026
Meta
Junior
Mid March, 2026
Meta
Mid-level
Late February, 2026
Meta
Mid-level
Hello Interview Premium
Your account is free and you can post anonymously if you choose.