Object Model for Booking Rooms in Lark Calendar

Last updated: November 29, 2026

Quick Overview

Design the classes and core logic for booking meeting rooms in Lark Calendar: find a room with enough capacity that is free for a time range, book it, and support cancellation.

ByteDance
Software Engineering Fundamentals
Software Engineer
ByteDance
November 29, 2026
Software Engineer
Onsite
Software Engineering Fundamentals
Medium

0

0

0 solved


Design the classes and core logic for booking meeting rooms in Lark Calendar: find a room with enough capacity that is free for a time range, book it, and support cancellation.

Low-level design rounds at ByteDance often use their own products, and Lark Calendar room booking tests whether you can choose clean responsibilities and an efficient overlap check. The interviewer looks for clear class boundaries, correct interval logic, and awareness of concurrency when two people book at once.

What the Interviewer Expects
  • Separate Room (owns its schedule) from BookingService (selection policy)
  • Keep each room's bookings sorted and check overlap with binary search
  • Use half-open intervals so back-to-back meetings fit
  • Choose a sensible policy such as smallest room that fits
  • Discuss concurrent booking races and how to prevent double booking
Key Topics to Cover
object-oriented design
interval overlap
binary search
concurrency
How to Approach This
  1. Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
  2. Choose data structures based on access patterns, not familiarity.
  3. Prefer immutable data and message passing over shared mutable state for concurrency.
  4. Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
  • Support recurring weekly meetings.
  • Two users book the last room at the same instant: how do you guarantee one wins?
  • Add buildings and floors and prefer rooms near the organizer.
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: book(attendees, start, end) returns a room id or None; cancel(room_id, start, end). Rooms have capacities. Intervals are half-open. Policy: pick the smallest room that fits to keep big roo...

High-Level Design

Room holds an id, capacity and a sorted list of (start, end) bookings, and answers is_free. BookingService holds the rooms and the selection policy. That split lets the policy change (nearest floor, p...


Submit Your Answer
Markdown supported