DEV Community

ZeeshanAli-0704
ZeeshanAli-0704

Posted on

Design a parking lot system?

What are Functional Requirements?

The following is a list of functional requirements for a parking lot system:

  • The parking lot system should be able to park cars, bikes, and handicapped vehicles.
  • The system should be able to calculate the cost of parking for each type of vehicle.
  • The system should be able to keep track of the time a vehicle is parked.
  • The system should be able to remove a vehicle from a parking spot.
  • The system should be able to check the availability of parking spots and handicapped spots on a specific floor.
  • The system should be able to calculate the number of hours a vehicle has been parked.

Non-Functional Requirements for Parking Lot

  • The system should be efficient and respond quickly to user requests.
  • The system should have a well-designed interface to make it easy to use.
  • The system should be efficient and respond quickly to user requests

We should have a parent parking spot Class & individual spot classes will derive this spot classes example

  • parent parking lot class [ abstract class]
    -individual class derived from parent are

    • =>handicapped
    • =>compact
    • =>large
    • =>2 wheeler
  • Parking ticket

    • id
    • parking spot id
    • spot type
    • time

-Terminal[ abstract class]
-individual class derived from parent are
=> Entry Terminal
=> exit Terminal

  • Parking strategy / nearest spot we can use a min-heap data structure.
  • let say we have created a 4 min heap & now we have spot added under this min-heap in order of distance from enterance
  • when we call min head from any gate it will give the nearest spot
  • mark spot as reserved & moved to reserved spots from available slots
  • mark spot as reserved & remove from all min heap structure

Payment Processing

  • credit card
  • cash

Image description

Top comments (0)