Goals:

  • Determine capability to understand the problem and gather the necessary requirements

  • Understand thought process and approach in coming up with the solution/design

  • Determine overall knowledge of different software components

    • Databases (SQL, noSQL)

    • Messaging systems (queues, topics)

    • APIs

  • Determine knowledge/experience in designing solutions using UML or other similar tools/frameworks

    • High-level architecture diagram (ex: data flow diagram, component/deployment diagram)

    • Use case diagram

    • Class diagram or ERD

    • Activity diagram

    • Other diagrams

  • Determine knowledge of architectural/coding/design patterns

  • Determine ability to communicate reasons for decisions

Problem Description:

Design a parking lot system that manages parking spaces. The parking spaces may be located in different floors. They also come in different types like Compact, Large, Handicapped, Motorcycle, etc. Aside from managing the spaces, the system also marks whether a parking space is available or not and which customer occupies the space. It also includes the computation of how much a customer should pay for using the parking space, supporting a per-hour parking fee model.

System Requirements:

The specific system requirements can be given to the candidate or the candidate can ask for clarifications leading to obtaining these requirements.

  1. The parking lot should have multiple floors where customers can park their cars.

  2. The parking lot should have multiple entry and exit points.

  3. Customers can collect a parking ticket from the entry points and can pay the parking fee at the exit points on their way out.

  4. Customers can pay the tickets at the automated exit panel or to the parking attendant.

  5. Customers can pay via both cash and credit cards.

  6. Customers should also be able to pay the parking fee at the customer’s info portal on each floor. If the customer has paid at the info portal, they don’t have to pay at the exit.

  7. The system should not allow more vehicles than the maximum capacity of the parking lot. If the parking is full, the system should be able to show a message at the entrance panel and on the parking display board on the ground floor.

  8. Each parking floor will have many parking spots. The system should support multiple types of parking spots such as Compact, Large, Handicapped, Motorcycle, etc.

  9. The Parking lot should have some parking spots specified for electric cars. These spots should have an electric panel through which customers can pay and charge their vehicles.

  10. The system should support parking for different types of vehicles like car, truck, van, motorcycle, etc.

  11. Each parking floor should have a display board showing any free parking spot for each spot type.

  12. The system should support a per-hour parking fee model. For example, customers have to pay $4 for the first hour, $3.5 for the second and third hours, and $2.5 for all the remaining hours.

Reference:

https://www.educative.io/courses/grokking-the-object-oriented-design-interview/gxM3gRxmr8Z

(The link also includes sample diagrams for the proposed solution.)