Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
Design Parking System (easy)
On this page

Problem Statement

Design a parking system for a parking lot that has three types of parking spaces: big, medium, and small. Each of these parking spaces has a limited number of slots available.

Implement Solution class constructor and the below methods:

  1. Solution(int big, int medium, int small): Initializes an object of the Solution class. This constructor receives the total number of available slots for each type of parking space: big, medium, and small.

  2. bool addCar(int carType): This method takes in an integer `carType

.....

.....

.....

Like the course? Get enrolled and start learning!

On this page