System requirements


Functional:

List functional requirements for the system (Ask the chat bot for hints if stuck.)...


  • check for is space available for a the given car-type.
  • book the slot and mark as parked.
  • By classifying the types of cars we can efficiently handle the space.
  • Give an option to reserved for certain amount of time.



Non-Functional:

  • Scalability
  • Security
  • Low latency




Capacity estimation

  • Types of users/cars parked daily.
  • How many parking lots
  • How many hours parked averagely?
  • How many reservation comes/day average?



API design

MethodURLReq bodyResponse codeResp body
post/check-in{carType : "", userId :"" ,parkinglotid:""}201 - booked, 404 - no slot{ bookedID :"", parkingNumber : "", costPermin ="", bookedTime ="",carType = "",parkinglotid:""}
post/check-out{bookedIId = "", userId : "", parkingNumber :"",parkinglotid:""}201-checked out, 404 - not booked{ checoutid : "", bookedID :"", parkingNumber : "", costPermin ="", bookedTime ="",carType = ""}, checkoutTime :"", cost :"", durationparked : "",parkinglotid:""}
get/getSlots200 -ok , 204 - not content[{parkinglcn-number, carType},{},{}]
get/getSlots?from=time&to=time200 -ok , 204 - not content[{parkinglcn-number, carType},{},{}]
post/Users{email :"", car-type :""}201 created, 2xx already exist{userid : "", email: "", cartype:"}
DELETE/Users{userId:""}200 success, 404 not fount
PATCH/users{email :"", car-type :""}201 created, 2xx already exist{userid : "", email: "", cartype:"}
Post/pay{checkOutId:"", userid :"", "amount :"",parkinglotid:""}200 -ok , 5xx- not content{status : "", timePaid :"",parkinglotid:""}




Database design

erDiagram PARKING_LOT ||--o{ PARKING : contains PARKING ||--o{ PARKING_USER_MAPPING : reserves USER ||--o{ PARKING_USER_MAPPING : makes PARKING_LOT { string lot_id "Primary Key" string lot_name "Name of the parking lot" date created "Creation timestamp of the parking lot" boolean isOpen "Status indicating if the lot is open for parking" int capacity "Total parking capacity in the lot" } PARKING { string parking_id "Primary Key" string parking_lot_id "Foreign Key referencing PARKING_LOT" boolean isWorking "Status indicating if the parking spot is operational" string car_type_parkable "The type of car that can use this parking spot" } USER { string user_id "Primary Key" string email "Email address of the user" string car_type "Type of car owned by the user" } PARKING_USER_MAPPING { string id "Primary Key" string user_id "Foreign Key referencing USER" string parking_id "Foreign Key referencing PARKING" timestamp time "The time when the spot is reserved" boolean isReserved "Status indicating if the spot is reserved" }










High-level design

  • User service - for user management
  • Parking service - for managing parking
  • SQL for DB
  • Notification service to manage notification and reservations update






Request flows

Explain how the request flows from end to end in your high level design. Also you could draw a sequence diagram using the diagramming tool to enhance your explanation...






Detailed component design

Dig deeper into 2-3 components and explain in detail how they work. For example, how well does each component scale? Any relevant algorithm or data structure you like to use for a component? Also you could draw a diagram using the diagramming tool to enhance your design...






Trade offs/Tech choices

Explain any trade offs you have made and why you made certain tech choices...






Failure scenarios/bottlenecks

Try to discuss as many failure scenarios/bottlenecks as possible.






Future improvements

What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?