Requirements
Functional Requirements:
- Allow reservation of a parking spot.
- Process payment for the reservation.
- Enable parking of a car in the reserved spot.
- Support early departure before reservation time expires.
- Gate check-in/out.
- Handle no show.
Non-Functional Requirements:
- List the key non-functional requirements (eg low latency, scalability, reliability, etc.)...
- Allow a maximum of 20 cars to be checked-in at one time.
- Prevent double-booking: a spot can’t be reserved/occupied by two vehicles at overlapping times.
- Gate operations should be highly available (e.g., 99.9%+ uptime).
- Support spikes (rush hour) without gate slowdown.
- No data loss for reservations, payments, or gate events.
- Maintain performance as number of spots/reservations grows.
- Accurate reconciliation between reservations, occupancy, and payment state.
API Design
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...
GET /lots/{lotId}/availability?start=&end=&vehicleType=&needs=GET /lots/{lotId}/quote?start=&end=&vehicleType=&spotType=- POST /reservations/hold
- POST /reservations/{reservationId}/confirm
- POST /gates/{gateId}/check-in
- POST /gates/{gateId}/check-out
High-Level Design
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.
Detailed Component Design
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.