Technical2026-08-16
Height of a binary tree
AI-Expanded — inferred from the question title, not from the original candidate report
Given the root node of a binary tree, write a function to determine its maximum depth, defined as the number of nodes along the longest path from the root node down to the farthest leaf node. Your solution should return 0 for an empty tree and correctly account for the height of trees with varying structures.
Context & Summary
Face-to-face interview (1 hour 30 mins) where the interviewer asked three technical questions and discussed OOPs concepts.
💻 Coding practice works best on desktop.
Code editors are too cramped on mobile screens.
Loading editor...
AI can automatically infer and generate example test cases for this question based on standard algorithmic constraints.
InterviewDigest