List the key functional requirements for the system (Ask the AI for hints if stuck)...
List the key non-functional requirements (performance, scalability, reliability, etc.)...
1000 office locations
each office location has 100 rooms
so 100K rooms total
100K to 1M employee total
booking allowed for next 1 to 3 year
approx 1000 days * 1000 minutes each day = 1M minutes * 100K = 100B room minutes of resources
at peak time:
mostly people from same office will book a room, each office has 1K to 10K employee at the max
not more than 100 to 500 will try to book the same room at a given time and not all of the requests will reach at the very same time(practically for this less count)
This is not a very large load for a server or DB to handle
Define the APIs expected from the system. This is your chance to analyze and define the read and write paths so that you can come up with the high-level design...
1) To book a room for a given time period:
POST booking.com/v1/room/book
input:
roomId
userDetails
timePeriod
output: booking confirmation with a booking ID upon success
2) To view availability of room(s) for a given time period
GET booking.com/v1/room/availability?startTime=20250404103000&endTime=20250404110000
output:
boolean: true/false (or array of booleans for multiple rooms)
3) To view bookings of room(s) for a given time period
GET booking.com/v1/room/bookings?startTime=t1&endTime=t2
output:
array of bookings
each booking has:
startTime
endTime
DELETE booking.com/v1/room/book/{bookingId}
GET booking.com/v1/user/profile/{userId}
Describe the overall system architecture. Identify the main components needed to solve the problem end-to-end. Use the diagramming tool to create a block diagram.
1st option is preferred for cases where we need to support lot of concurrent operations with low latency.
2nd option is preferred for simplicity and comparatively less load.
Depending on our use case we can choose one.