Requirements
The parking lot system will be used to manage vehicle parking across multiple floors. Main functionalities include:
Parking lot assignment:
- The parking spot assignment should be based on vehicle size and spot availability.
- It should manage spot reservations and ensure optimal usage of space
Spot availability checking:
- Users and the system should be able to check the availability of parking spots in real-time.
- The system should provide an interface for users to view available parking spots accross different floors.
Fee calculation:
- The system should calculate fee based on parking duration.
- Different rates may apply based on the type of the vehicle (e.g. bikes, cars and trucks) and parking spot (e.g. premium, regular).
User Roles and Permissions:
- The system will have different roles, including Admin, Attendant, and User (vehicle owner).
- Admins can configure parking lot settings, including pricing and floor management.
- Attendants can check-in/check-out vehicles and manage spot assignments.
- Users can reserve spots, check availability, and view their parking history.
Support for Multiple Floors:
- The system should manage parking spots across multiple floors, allowing users to park on any available floor.
- Floor-specific features might include reserved spots for electric vehicles, handicapped spaces, and charging stations.
Define Core Objects
ParkingLot
Analyze Relationships
Determine how these objects will interact with each other to fulfill the use cases...
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
Consider using design patterns (e.g., Factory, Singleton, Observer, Strategy) that fit the problem...
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 { ... } // Example
Adhere 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
Explain how your design can handle changes in scale and whether it would be easily to extend with new functionalities...
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...