LLD - Design — Parking Lot System
In a parking system, you have enums
- Cars use COMPACT spots
- Bikes use HANDICAPPED spots
- Trucks use LARGE spots
Which design approach best ensures no invalid spot assignment happens?
VehicleType { CAR, BIKE, TRUCK } and SpotType { COMPACT, LARGE, HANDICAPPED }. You want to assign spots such that:- Cars use COMPACT spots
- Bikes use HANDICAPPED spots
- Trucks use LARGE spots
Which design approach best ensures no invalid spot assignment happens?
