Amazon·Software Engineer·Onsite - Coding / Algorithms
- Design a multi-level parking lot system that supports different vehicle types and spot sizes. Identify the main entities, sketch a class diagram with clear responsibilities, fields, and methods, and implement the core classes with attention to encapsulation and extensibility.
- Implement park(vehicle), leave(vehicle), and availability_summary() methods. How do you handle spot assignment and freeing spots for vehicles that occupy multiple spots?
- Walk through your design and discuss how it would accommodate future requirements like hourly billing, reservations, EV-charging spots, and multi-tenant lots.
“I started with the entities and drew out ParkingLot, Level, ParkingSpot, and the Vehicle hierarchy pretty quickly.”