Design a parking lot system (software + core components) that supports multiple entry/exit gates, different spot types, ticketing, and payment.
Functional requirements
-
Vehicles enter via an entry gate and receive a ticket.
-
Vehicles park in an appropriate available spot (e.g., compact/large/EV/handicap).
-
Vehicles exit via an exit gate and pay based on time parked (and possibly vehicle/spot type).
-
The system should:
-
Track spot occupancy and availability in near real-time.
-
Handle multiple floors/zones.
-
Support lost-ticket scenarios and payment failures.
Non-functional requirements
-
Correctness under concurrent arrivals/departures.
-
High availability for gate operations (tickets and exits should still work during partial outages).
-
Low latency at gates (avoid long lines).
-
Auditable records for payments and occupancy.
Provide:
-
High-level architecture
-
Core data model
-
Key APIs
-
Main flows (enter, park, exit, payment)
-
Concurrency/consistency approach and failure handling