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.
0
Early April, 2026
Meta
Junior
Mid March, 2026
Meta
Mid-level
Early March, 2026
Meta
Senior
Hello Interview Premium
Your account is free and you can post anonymously if you choose.