PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Atlassian

Assign tennis bookings to minimum courts

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of interval scheduling and temporal resource allocation, testing algorithm design, complexity analysis, and appropriate data-structure use for assigning bookings to a minimal number of courts.

  • medium
  • Atlassian
  • Coding & Algorithms
  • Software Engineer

Assign tennis bookings to minimum courts

Company: Atlassian

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

## Expanding Tennis Club (Interval Scheduling) You run a tennis club with an unlimited number of courts. Each booking has a start and finish time. ```text class BookingRecord { int id; int startTime; int finishTime; } List<Assignment> assignCourts(List<BookingRecord> bookingRecords) ``` ### Part (a) Implement `assignCourts` to return a **plan that assigns each booking to a specific court** such that: - No court has overlapping bookings. - The total number of courts used is **minimized**. Your output can be any structure that includes, for each booking, the assigned `courtId`. ### Part (b) – maintenance buffer after each booking After each booking on a court, the court requires a fixed maintenance time `X` (e.g., cleaning) before it can be used again. - If a booking ends at time `t`, the next booking on the same court cannot start before `t + X`. Update the assignment logic accordingly. ### Part (c) – maintenance only after some usage Follow-up variant: maintenance is not required after every booking, but only after a court has accumulated a certain amount of usage (clarify with the interviewer whether this threshold is in number of bookings or total time used). Update the assignment approach to support this rule. ### Notes - Times are integers. - You may assume `startTime < finishTime`. - State any additional constraints you rely on (e.g., max N).

Quick Answer: This question evaluates understanding of interval scheduling and temporal resource allocation, testing algorithm design, complexity analysis, and appropriate data-structure use for assigning bookings to a minimal number of courts.

Related Interview Questions

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

Expanding Tennis Club (Interval Scheduling)

You run a tennis club with an unlimited number of courts. Each booking has a start and finish time.

class BookingRecord {
  int id;
  int startTime;
  int finishTime;
}

List<Assignment> assignCourts(List<BookingRecord> bookingRecords)

Part (a)

Implement assignCourts to return a plan that assigns each booking to a specific court such that:

  • No court has overlapping bookings.
  • The total number of courts used is minimized .

Your output can be any structure that includes, for each booking, the assigned courtId.

Part (b) – maintenance buffer after each booking

After each booking on a court, the court requires a fixed maintenance time X (e.g., cleaning) before it can be used again.

  • If a booking ends at time t , the next booking on the same court cannot start before t + X .

Update the assignment logic accordingly.

Part (c) – maintenance only after some usage

Follow-up variant: maintenance is not required after every booking, but only after a court has accumulated a certain amount of usage (clarify with the interviewer whether this threshold is in number of bookings or total time used). Update the assignment approach to support this rule.

Notes

  • Times are integers.
  • You may assume startTime < finishTime .
  • State any additional constraints you rely on (e.g., max N).

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Atlassian•More Software Engineer•Atlassian Software Engineer•Atlassian Coding & Algorithms•Software Engineer 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.