The classic prompt, answered as a structure rather than a list of nouns.
Entities and values
ParkingLot the aggregate: floors, admits a vehicle, releases it
Floor holds spots, knows its own free count per spot type
Spot id, SpotType, occupied-by; enforces fits(vehicle)
SpotType enum MOTORCYCLE, COMPACT, LARGE, ACCESSIBLE
Vehicle abstract; Motorcycle, Car, Van - each knows its size
Ticket id, spot, vehicle, issuedAt (a value, immutable)
Policies behind interfaces
SpotAssignment strategy: nearest-to-entrance, or by floor balance
PricingPolicy strategy: hourly, day-rate, free-first-15-minutes
Payment interface: cash, card - one adapter each
Services
EntryGate issue ticket = assign spot + mark occupied, atomically
ExitGate price ticket + take payment + free spot
The scoring is mostly in three decisions rather than the class list. The first is
where fits lives: putting it on Spot as a function of SpotType and vehicle
size means adding an electric-vehicle spot is one enum constant and one rule,
whereas a switch in the gate service means finding every switch.
The second is making assignment and pricing interfaces. The interviewer will ask
"what if we want to charge differently at weekends" or "assign the nearest spot",
and having named those as the two axes of variation up front means the answer is
"a second PricingPolicy" rather than a redesign.
The third is concurrency, which is where most candidates stop short. Two cars at
two gates can be assigned the same spot unless the claim is atomic — a compare-
and-set on the spot's state, or a lock per floor, and saying which you would use
and why is the strongest thing you can add.
What to leave out deliberately: no ParkingLotManager, no getters and setters
enumerated, no database schema unless asked. Say aloud that you are treating
persistence as out of scope so the time goes on the domain, because otherwise
the interviewer cannot tell the difference between a choice and an omission.