PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Atlassian

Assign bookings to minimum tennis courts

Last updated: Mar 29, 2026

Quick Overview

This question evaluates interval scheduling and resource-allocation competencies, testing algorithmic and data-structure knowledge for handling time-interval conflicts and producing a minimal concurrent-resource assignment.

  • medium
  • Atlassian
  • Coding & Algorithms
  • Machine Learning Engineer

Assign bookings to minimum tennis courts

Company: Atlassian

Role: Machine Learning Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

You are given a list of tennis court bookings. Each booking has a **start** time and an **end** time. ## Task Return an assignment plan that: 1. Assigns **each booking** to a specific court (e.g., court IDs `1..k`). 2. Ensures **no court has overlapping bookings**. 3. Uses the **minimum number of courts** (assume unlimited courts are available). You may return: - The **minimum number of courts** needed, and - An **array of court IDs** aligned with the input bookings (i.e., `assignment[i]` is the court used by booking `i`). ## Follow-up: Maintenance buffer After a booking ends, the court is unavailable for a fixed **maintenance time** `M` (e.g., minutes). That means a booking `[s2, e2]` can reuse the same court after booking `[s1, e1]` only if: - `s2 >= e1 + M` Update your approach to support this requirement. ## Notes / Assumptions - Time can be treated as integers. - You should aim for an efficient solution (e.g., for large `n`).

Quick Answer: This question evaluates interval scheduling and resource-allocation competencies, testing algorithmic and data-structure knowledge for handling time-interval conflicts and producing a minimal concurrent-resource assignment.

Related Interview Questions

  • Find a secret word using match feedback - Atlassian (hard)
  • Compute a moving average on a stream - Atlassian (hard)
  • Implement sequential and parallel URL requests - Atlassian (medium)
  • Implement sliding-window rate limiter function - Atlassian (medium)
  • Merge intervals and design rating APIs - Atlassian (medium)
Atlassian logo
Atlassian
Oct 15, 2025, 12:00 AM
Machine Learning Engineer
Onsite
Coding & Algorithms
3
0
Loading...

You are given a list of tennis court bookings. Each booking has a start time and an end time.

Task

Return an assignment plan that:

  1. Assigns each booking to a specific court (e.g., court IDs 1..k ).
  2. Ensures no court has overlapping bookings .
  3. Uses the minimum number of courts (assume unlimited courts are available).

You may return:

  • The minimum number of courts needed, and
  • An array of court IDs aligned with the input bookings (i.e., assignment[i] is the court used by booking i ).

Follow-up: Maintenance buffer

After a booking ends, the court is unavailable for a fixed maintenance time M (e.g., minutes). That means a booking [s2, e2] can reuse the same court after booking [s1, e1] only if:

  • s2 >= e1 + M

Update your approach to support this requirement.

Notes / Assumptions

  • Time can be treated as integers.
  • You should aim for an efficient solution (e.g., for large n ).

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Atlassian•More Machine Learning Engineer•Atlassian Machine Learning Engineer•Atlassian Coding & Algorithms•Machine Learning Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ 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.