Search
⌘K
Get Premium
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
Late November, 2025
Meta
Senior
Early November, 2025
Meta
Mid-level
Early August, 2025
Meta
Senior
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.