Skip to content

Instantly share code, notes, and snippets.

@KevinNha
Created October 13, 2022 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KevinNha/c2602e158836ae613292c8ae8b12e005 to your computer and use it in GitHub Desktop.
Save KevinNha/c2602e158836ae613292c8ae8b12e005 to your computer and use it in GitHub Desktop.
Design a Hotel Reservation System
System Architecture and Design
This is a whiteboarding exercise.
Just like pair programming, ask clarifying questions to understand the variables you should take into consideration.
Feel free to guide the conversation to an area where you are comfortable but be prepared to go deep into the conversation about the technical details and tradeoffs encountered.
Ask for validation of your answers to ensure you are covering the question asked.
This section will require some whiteboarding (no additional coding).
Your interviewers will ask you to design a hotel booking system. This interview is an opportunity to collaborate and iterate on a solution with your interviewers.
You will be asked to create a representation of your design and provide a high level overview.
Focus on your areas of strength. We want you to design a system that shows off your knowledge and skills.
You are not expected to have designed this system before the interview—the interviewers will guide you on the specific requirements and the assumptions to make during the exercise.
Make sure to discuss your approach and thought process throughout each step of the discussion.
@fleejy
Copy link

fleejy commented Oct 13, 2022

From a network load perspective, you'd have a loadbalancer set up to direct to appropriate destination.
Same for database cluster (e.g., AWS RDS cluster with primary and at least 2 read replicas)

graph TD
  A[Client] --> B[Load Balancer]
  B --> C[Server01 - us-east-1]
  B --> D[Server02 - us-central-1]
  B --> E[Server03 - us-west-1]

@fleejy
Copy link

fleejy commented Oct 13, 2022

Then, there would need to be a queuing system for doing chronological operation.
Database locking mechanism as well to ensure guests don't overlap.
Represent database with a few tables.

  • guest table
  • room table with attributes like room number, guest count, amenities that can be filtered during the booking process
  • booking table with room
erDiagram
    GUEST o{--}o BOOKING : "can book"
    GUEST {
        string guestId
        string name
        string phone
        string paymentMethod
    }
    ROOM ||--|| BOOKING : booked
    ROOM {
        string roomNumber
        int maxOccupant
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment