Python data engineering interview problem. Difficulty: advanced. Pattern: Trees. About 18 minutes. Part of the Pro drill bank.
Maximum depth of a binary tree from level-order input. Treat this as a production helper: match the contracted return shape, including empty and duplicate inputs.
Implement max_depth(level_order: list) -> int.
Input: max_depth([3, 9, 20, None, None, 15, 7]) Output: 3 Root to 15/7 is depth 3.
Topics: lakebench, python, depth, dfs.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Maximum depth of a binary tree from level-order input.
Implement `max_depth(level_order: list) -> int`. Example: `[3, 9, 20, None, None, 15, 7]` → `3`. Keep the harness.