Loading...
The Tree Measurer
A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- easy
- Seniority
- junior, mid
Problem
A file system tool needs to determine the maximum directory nesting depth for display purposes. Write a function that takes the root of a binary tree and returns its maximum depth - the number of nodes along the longest path from root to the farthest leaf.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.