ParkingLot will be a single instance per parking lot which will initiate vehicle type detection, assign available parking spot to a vehicle. Each ParkingLot will have have multiple Floors. Every Floor has multiple ParkingSpots. Each ParkingSpot has the maximum size of the VehicleType it can accommodate along with the chargePerHour. ParkingSpot also has flags describing if the spot is available, if its an EV parking spot and if the spot is under maintenance. Vehicle object has the VehicleType and a method to identify the type of Vehicle. ParkingLot will reserve a spot and issue a ParkingTicket to the Vehicle.
Design inheritance trees where applicable to promote code reuse and polymorphism. This step involves identifying common attributes and behaviors that can be abstracted into parent classes...
Attributes: For each class, define the attributes (data) it will hold...
Methods: Define the methods (functions) that operate on the attributes. Ensure they align with the object's responsibilities and adhere to the principle of encapsulation.
public class Car { ... } // ExampleCheck and explain whether your design adheres to solid principles (Ask interviewer what SOLID principle is if you can not recall it.)...
For larger
Try creating a class, flow, state and/or sequence diagram using the diagramming tool. Mermaid flow diagrams can be used to represent system use cases. You can ask the interviewer bot to create a starter diagram if unfamiliar with the tool. Briefly explain your diagrams if necessary...
Critically examine your design for any flaws or areas for future improvement...