PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Zest

Compute tree depth and meeting rooms

Last updated: May 3, 2026

Quick Overview

This question evaluates skills in tree traversal and recursion for computing maximum depth of a binary tree, alongside interval scheduling and resource allocation for determining the minimum number of meeting rooms, testing reasoning about data structures such as trees and interval endpoints.

  • hard
  • Zest
  • Coding & Algorithms
  • Data Scientist

Compute tree depth and meeting rooms

Company: Zest

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: hard

Interview Round: Onsite

Solve both coding problems. ## Problem 1: Maximum depth of a binary tree Given the root of a binary tree, return its maximum depth. The maximum depth is the number of nodes on the longest path from the root node down to a leaf node. Assumptions: - If the tree is empty, return 0. - The tree may be highly unbalanced. - The number of nodes can be up to 100,000, so consider recursion-depth limitations depending on the language. Example: Input tree: `3, 9, 20, null, null, 15, 7` Output: `3` ## Problem 2: Minimum meeting rooms Given an array of meeting time intervals `intervals`, where each interval is `[start, end)`, return the minimum number of conference rooms required so that all meetings can be held. Assumptions: - `start < end` for every meeting. - Times are integers. - Intervals are half-open, so a meeting ending at time `10` does not conflict with another meeting starting at time `10`. - The number of intervals can be up to 100,000. Example: Input: `[[0, 30], [5, 10], [15, 20]]` Output: `2` Example: Input: `[[7, 10], [10, 12]]` Output: `1`

Quick Answer: This question evaluates skills in tree traversal and recursion for computing maximum depth of a binary tree, alongside interval scheduling and resource allocation for determining the minimum number of meeting rooms, testing reasoning about data structures such as trees and interval endpoints.

Zest logo
Zest
Apr 5, 2026, 12:00 AM
Data Scientist
Onsite
Coding & Algorithms
0
0

Solve both coding problems.

Problem 1: Maximum depth of a binary tree

Given the root of a binary tree, return its maximum depth. The maximum depth is the number of nodes on the longest path from the root node down to a leaf node.

Assumptions:

  • If the tree is empty, return 0.
  • The tree may be highly unbalanced.
  • The number of nodes can be up to 100,000, so consider recursion-depth limitations depending on the language.

Example: Input tree: 3, 9, 20, null, null, 15, 7 Output: 3

Problem 2: Minimum meeting rooms

Given an array of meeting time intervals intervals, where each interval is [start, end), return the minimum number of conference rooms required so that all meetings can be held.

Assumptions:

  • start < end for every meeting.
  • Times are integers.
  • Intervals are half-open, so a meeting ending at time 10 does not conflict with another meeting starting at time 10 .
  • The number of intervals can be up to 100,000.

Example: Input: [[0, 30], [5, 10], [15, 20]] Output: 2

Example: Input: [[7, 10], [10, 12]] Output: 1

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Zest•More Data Scientist•Zest Data Scientist•Zest Coding & Algorithms•Data Scientist Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.