Design a Parking Lot
Problem Statement
Design the Low-Level Design (LLD) of a Parking Lot Management System that can manage entry, parking, and exit of vehicles efficiently.
The system should handle multiple parking floors, different vehicle types, and parking ticket generation, ensuring optimal use of parking slots and smooth vehicle flow.
Your goal is to focus on object modeling, class design, and interaction logic, not large-scale system architecture.
🎯 Goal
Design a system that can:
✅ Functional Requirements
1. Parking Lot Setup
2. Vehicle Entry
If the lot is full → return “Parking Full”.
3. Vehicle Exit
4. Fee Calculation
5. Search & Status
⚙️ Non-Functional Requirements
🧱 Key Classes to Design
ClassResponsibility
ParkingLot
Central class managing all floors, slots, and ticketing.
ParkingFloor
Contains multiple slots and tracks availability.
ParkingSlot
Represents an individual parking space (id, type, status).
Vehicle
Represents a vehicle (number, type, owner).
Ticket
Represents issued ticket (ticketId, entryTime, vehicle, slot).
ExitGate
Handles fee calculation and slot release.
FeeCalculator
Computes parking charge based on duration and vehicle type.
ParkingManager
Orchestrates slot assignment, entry, and exit operations.
🧩 Example Class Relationships
1
2ParkingLot
3 ├── List<ParkingFloor>
4 ├── issueTicket(Vehicle)
5 ├── exitVehicle(Ticket)
6
7ParkingFloor
8 ├── int floorNumber
9 ├── List<ParkingSlot>
10
11ParkingSlot
12 ├── String id
13 ├── VehicleType type
14 ├── boolean isAvailable
15
16Vehicle
17 ├── String registrationNumber
18 ├── VehicleType type
19
20Ticket
21 ├── String ticketId
22 ├── Vehicle vehicle
23 ├── ParkingSlot slot
24 ├── Date entryTime
25 ├── Date exitTime🔄 Example Flow
Input:
1
2Vehicle: KA-01-AB-1234 (Car)Process:
1
2Ticket ID: T001
3Entry Time: 10:00 AM
4Vehicle: KA-01-AB-1234
5Slot: F1-C12Exit at 1:30 PM
Output:
1
2Payment Successful: ₹80
3Thank you! Visit again.🔐 Concurrency Example
If multiple cars arrive simultaneously:
🧠 Possible Extensions
✅ Summary:
Design an object-oriented Parking Lot system (LLD) that:
Focus on class relationships, slot allocation logic, and thread-safe booking.