User should be able to park at a space of their choice and pay based on the number of hours.
There should be different sized lots to handle differently sized cars.
Payment system should track the number of hours remaining for each lot.
System to display the number of available lots
User can reserve parking slot
Efficient entry and exit
Notify users when their parking session expires
Allow disability or permit parking
500 total lots. Maximum 10 cars enter or exit per minute
pay(slot_number, plate_number, hours)
reserve(slot_number)
enter(slot_number, plate_number)
exit(slot_number, plate_number)
Lot
Parking lot
sequenceDiagram participant User participant PaymentAPI participant ParkingLotSystem User->>PaymentAPI: Reserve Parking Slot PaymentAPI-->>User: Payment Confirmation User->>ParkingLotSystem: Update Lot ID ParkingLotSystem-->>ParkingLotSystem: Set occupied to true ParkingLotSystem-->>ParkingLotSystem: Set booked_until value ParkingLotSystem-->>ParkingLotSystem: Set plate_number ParkingLotSystem-->>ParkingLotSystem: Set parked_until value ParkingLotSystem-->>ParkingLotSystem: Decrease available lots by 1 User->>ParkingLotSystem: Enter Lot ID ParkingLotSystem-->>ParkingLotSystem: Record plate_number ParkingLotSystem-->>ParkingLotSystem: Set occupied to true User->>ParkingLotSystem: Exit Lot ID ParkingLotSystem-->>ParkingLotSystem: Clear plate_number ParkingLotSystem-->>ParkingLotSystem: Set occupied to false ParkingLotSystem-->>ParkingLotSystem: Increase available lots by 1
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...
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...
Explain any trade offs you have made and why you made certain tech choices...
Try to discuss as many failure scenarios/bottlenecks as possible.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?