Office Seat-Management App Design

Difficulty: MEDIUMCategory: LLDFrequency: 1Asked On 2024-01-06

Problem Statement

🎯 Objective


Design a system that allows employees to book, release, and manage office seats in a flexible workplace environment.

The goal is to optimize seat allocation, real-time availability tracking, and booking management while supporting features like seat preferences and team-based allocations.


πŸ”Ή Context


Modern offices use hybrid work models, where not all employees are in the office every day.


An Office Seat-Management App helps companies manage this by:


β€’Allowing employees to reserve seats for specific days,
β€’Ensuring no double-booking,
β€’Supporting admin-level controls (e.g., block seats for maintenance or visitors),
β€’Enabling visibility into seat occupancy analytics.


You are tasked with designing the class-level structure (LLD) for such a system.


βœ… Functional Requirements


πŸ§‘β€πŸ’Ό Employee Features


View Seat Availability

β€’Employees can view available seats by date, floor, or zone.

Book a Seat

β€’Reserve a seat for a given date or time slot.
β€’Prevent double booking of the same seat or by the same user.

Cancel Reservation

β€’Employees can cancel a booking before the date/time of reservation.

View My Bookings

β€’Employees can view their upcoming and past seat reservations.

Seat Preferences (Optional)

β€’Users can mark preferred locations (e.g., near team, near window).


πŸ§‘β€πŸ’Ό Admin Features


1.Block/Unblock Seats
β€’Temporarily disable seats for cleaning, repair, or visitors.
2.Manage Seating Layout
β€’Add/remove seats, define zones, and configure floors.
3.View Utilization Reports
β€’View daily/weekly occupancy and seat usage patterns.


βš™οΈ Non-Functional Requirements


RequirementDescription


Scalability

Should support multiple office locations, floors, and hundreds of seats.


Consistency

Ensure no seat double-booking (atomic transactions).


Extensibility

Allow easy addition of features like team-based reservations or recurring bookings.


Performance

Booking and availability checks should be fast (O(log n) ideally).


Usability

Should expose APIs that can be integrated with a web/mobile front-end.


🧩 Core Entities & Responsibilities


ClassDescription


Seat

Represents an individual seat with unique ID, location, status (available/booked/blocked).


Floor

Represents a collection of seats in a given floor.


Office

Represents a building or office location with multiple floors.


Employee

Represents a user who can book or cancel seats.


Booking

Represents a reservation made by an employee for a seat on a particular date/time.


BookingManager

Handles creation, cancellation, and validation of bookings.


SeatManager

Manages seat availability, status updates, and layout changes.


Admin

Subclass of Employee with elevated privileges to block/unblock or add seats.


🧾 Sample Class Diagram (Text Form)

1 2β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” 3β”‚ Office β”‚ 4│─────────────────────────│ 5β”‚ - officeId β”‚ 6β”‚ - name β”‚ 7β”‚ - floors: List<Floor> β”‚ 8β”‚ + getAvailableSeats() β”‚ 9β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ 10 β”‚ 11 β–Ό 12β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” 13β”‚ Floor β”‚ 14│─────────────────────────│ 15β”‚ - floorId β”‚ 16β”‚ - seats: List<Seat> β”‚ 17β”‚ + getSeatById() β”‚ 18β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ 19 β”‚ 20 β–Ό 21β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” 22β”‚ Seat β”‚ 23│─────────────────────────│ 24β”‚ - seatId β”‚ 25β”‚ - location β”‚ 26β”‚ - status (AVAILABLE, BOOKED, BLOCKED) β”‚ 27β”‚ + isAvailable(date) β”‚ 28β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ 29 30β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” 31β”‚ Booking β”‚ 32│─────────────────────────│ 33β”‚ - bookingId β”‚ 34β”‚ - employeeId β”‚ 35β”‚ - seatId β”‚ 36β”‚ - date β”‚ 37β”‚ - status (CONFIRMED/CANCELLED) β”‚ 38β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ 39 40β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” 41β”‚ BookingManager β”‚ 42│─────────────────────────│ 43β”‚ + createBooking(emp, seat, date) β”‚ 44β”‚ + cancelBooking(bookingId) β”‚ 45β”‚ + getBookingsForDate(date) β”‚ 46β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜


🧠 Example Scenario


Input:


1.Office has 2 floors with 50 seats each.
2.Sahil wants to book Seat S12 on 25th Oct 2025.
3.Admin blocks Seat S20 for maintenance.


Flow:


1.BookingManager.createBooking(employee="Sahil", seat="S12", date="25-Oct-2025")
2.System checks seat availability using SeatManager.
3.If available, creates a new Booking and updates seat status to BOOKED.
4.Blocked seats are skipped in availability search.


Output:

1 2Booking successful! 3Seat S12 reserved for Sahil on 25-Oct-2025.


βš™οΈ Design Patterns


β€’Singleton Pattern β†’ For BookingManager or SeatManager (centralized control).
β€’Factory Pattern β†’ To instantiate Office, Floor, and Seat entities dynamically.
β€’Observer Pattern (Optional) β†’ To notify users/admins about cancellations or seat status updates.
β€’Strategy Pattern β†’ For different booking strategies (random allocation, preference-based, etc.).


πŸ“ˆ Possible Extensions


β€’Team-based seat allocation.
β€’Recurring or multi-day bookings.
β€’Integration with meeting room booking system.
β€’Live seat map visualization using sensors (IoT).
β€’Analytics dashboard for seat utilization.


πŸ’¬ Interview Prompt Summary

Design a Seat Management System for an Office.
The system should allow employees to view, book, and cancel seat reservations while ensuring that seats are not double-booked.
Include class design for core entities like Seat, Floor, Booking, and BookingManager, and consider extensibility for admins, preferences, and analytics.








ChatGPT ca

Solution

Comments