Binary Tree Postorder Traversal
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 binary tree, return the list of its node values in **postorder**: for every node, all values from its left subtree come first, then all values from its right subtree, then the node's own value.
Return an empty list for an empty tree. The recursive version is short; as a follow-up, produce the same order iteratively with an explicit stack.
Examples
Constraints
- 0 <= number of nodes <= 1000
- -100 <= Node.val <= 100
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.