Requirements

Determine the different ways the system will be used. This includes main functions the system needs to perform and who will use it.

The system will need to track which spots are available and which have been filled. It will also need to track when they were filled and for how long. It should also have the location of the parking spots. There should be functionality to get all relavent information for a spot easily. Have defined what vehicle sizes are compatible with the parking spots.


We may also need a fee calculator function that gives us the fee.


Define Core Objects

Based on the requirements and use cases, identify the main objects of the system...

There will be an object which is a parking spot.

There will be an object which is a vehicle.

There is also the parking lot object.




Analyze Relationships

Determine how these objects will interact with each other to fulfill the use cases...

the parking spot can be filled with a vehicle but only if the vehicle is compatible and the parking spot is empty

The parking lot will store parking spots and will keep a track of which are open and which are closed.





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...

no inheretence




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 public class Vehicle { private double size; private Spot spot; private bool parked=false; private Time tol; private Time top; Public Vehicle (double size, Spot spot) { this.size=size; this.spot=spot; } Public getsize (){ return this.size; } } public class Spot { private bool full = true; private double location; private double size; Public Spot(double location,double size) { this.location = location this.size=size } Public fill(Vehicle vehi, Time top) { if (vehi.getsize()<this.size){ full=true; this.top=time(); } else { throw exception } } Public empty(Time tol) { if this.full==true{ this.full=false; this.tol=tol; } } public class ParkingLot { Hashmap that has }


public class



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...