Find Bottom Left Tree Value
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
Given the root of a non-empty binary tree, return the value of the **leftmost node on the deepest level**. The deepest level is the one farthest from the root; among the nodes on that level, pick the one that appears first when the level is read from left to right.
Note that this node need not be a left child. If the deepest level has a single node that is a right child, that node is the answer.
A level-order traversal solves this in O(n) time.
Examples
Constraints
- 1 <= number of nodes <= 10^4
- -2^31 <= Node.val <= 2^31 - 1
- Values may repeat
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.