Requirements
- Allow users to reserve a spot in advance
- System should able to identify the vehicle size and assign spot accordingly
- If a spot corresponding to vehicle size is not available, assign the next higher slot but confirm with customer before assigning as it will incur higher charge.
- Provide customer with directions to the assigned spot
- Calculate fees at exit based on spot and time utilized (system will not account for demand surge)
- Any spot that becomes available is added to the availability for the vehicle types correspondingly
- Customers are able to make payments either using credit card, electronically, etc.
- System should allow customers to register and login
- Customers are able to view their parking history
- Notify customers on expiry of their parking reservation
- Spot maintenance flag
- Different fee structures for hourly, daily, monthly and yearly customers
- Disabled vehicle spots
- Analyze parking lot data for future optimizations
- Customers can search spots
Define Core Objects
- ParkingLot
- ParkingSpot
- Vehicle
- ParkingTicket
- Floor
Analyze Relationships
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.
Establish Hierarchy
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...
Design Patterns
Define Class Members (write code)
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 { ... } // ExampleAdhere to SOLID Guidelines
Check and explain whether your design adheres to solid principles (Ask interviewer what SOLID principle is if you can not recall it.)...
Consider Scalability and Flexibility
For larger
Create/Explain your diagram(s)
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...
Future improvements
Critically examine your design for any flaws or areas for future improvement...