Preparing your design workspace

Loading the problem and your saved attempt…

Design and Implement a Parking Lot

Model a parking journey and implement the allocation and release core safely.

Design a parking lot and implement its bounded executable core. For this exercise, assume a motorist arrives with a car or motorcycle, receives the lowest-numbered compatible available spot and a ticket, then exits by closing the ticket and releasing the spot.

Motorcycle spots accept only motorcycles; compact spots accept motorcycles or cars; large spots accept either vehicle type. Assigning a spot and issuing its ticket must be atomic so a spot cannot belong to two active tickets. Implement spot allocation, ticket creation, and ticket closure with spot release in memory.

Payment, pricing, reservations, display boards, persistence, and user-interface concerns are out of scope.