PracHub
QuestionsCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Uber

Schedule Non-Overlapping Meetings Efficiently

Last updated: May 3, 2026

Quick Overview

This question evaluates understanding of interval scheduling and overlap detection, proficiency in selecting efficient data structures for dynamic ordered intervals, and the ability to reason about algorithmic time and space complexity.

  • hard
  • Uber
  • Coding & Algorithms
  • Software Engineer

Schedule Non-Overlapping Meetings Efficiently

Company: Uber

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: hard

Interview Round: Onsite

Implement a meeting scheduler that stores meetings as half-open intervals `[start, end)`, where `start` and `end` are integer timestamps and `start < end`. The scheduler must support: 1. `book(start, end) -> bool`: Add the meeting if it does not overlap with any existing meeting. Return `true` if the meeting is booked, otherwise return `false` and leave the schedule unchanged. 2. `remove_before(time) -> int`: Given a cutoff timestamp, remove all meetings that end at or before `time`. Return the number of removed meetings. 3. `get_meetings() -> List[Tuple[int, int]]`: Return all currently scheduled meetings sorted by start time. Follow-up discussion: - What data structure would you use to optimize `book` and `remove_before`? - How would the complexity change if you used an unsorted list, a sorted array, or a balanced binary search tree? - What edge cases should be covered by tests? Example: ```text book(10, 20) -> true book(20, 30) -> true # Adjacent meetings are allowed. book(15, 25) -> false # Overlaps with [10, 20). book(5, 10) -> true remove_before(20) -> 2 # Removes [5, 10) and [10, 20). get_meetings() -> [(20, 30)] ``` Assume the number of meetings can be large, so the solution should be efficient.

Quick Answer: This question evaluates understanding of interval scheduling and overlap detection, proficiency in selecting efficient data structures for dynamic ordered intervals, and the ability to reason about algorithmic time and space complexity.

Related Interview Questions

  • Thread-Safe Token-Bucket Rate Limiter - Uber (medium)
  • Group Anagrams - Uber (medium)
  • Quadtree for 2D Geospatial Points - Uber (medium)
  • Deep Equality of Two Records - Uber (medium)
  • Shortest Path in a Grid with Blocked Cells - Uber (medium)
|Home/Coding & Algorithms/Uber

Schedule Non-Overlapping Meetings Efficiently

Uber logo
Uber
May 2, 2026, 12:00 AM
hardSoftware EngineerOnsiteCoding & Algorithms
7
0
Practice Read
Loading...

Implement a meeting scheduler that stores meetings as half-open intervals [start, end), where start and end are integer timestamps and start < end.

The scheduler must support:

  1. book(start, end) -> bool : Add the meeting if it does not overlap with any existing meeting. Return true if the meeting is booked, otherwise return false and leave the schedule unchanged.
  2. remove_before(time) -> int : Given a cutoff timestamp, remove all meetings that end at or before time . Return the number of removed meetings.
  3. get_meetings() -> List[Tuple[int, int]] : Return all currently scheduled meetings sorted by start time.

Follow-up discussion:

  • What data structure would you use to optimize book and remove_before ?
  • How would the complexity change if you used an unsorted list, a sorted array, or a balanced binary search tree?
  • What edge cases should be covered by tests?

Example:

book(10, 20) -> true
book(20, 30) -> true      # Adjacent meetings are allowed.
book(15, 25) -> false     # Overlaps with [10, 20).
book(5, 10) -> true
remove_before(20) -> 2    # Removes [5, 10) and [10, 20).
get_meetings() -> [(20, 30)]

Assume the number of meetings can be large, so the solution should be efficient.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Uber•More Software Engineer•Uber Software Engineer•Uber Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,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
  • AI Coding 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.