Skip to main content
SDMastery
easy6 min readUpdated 2026-10-03

Design a Parking Garage

Design a parking garage system with OOP modeling, sensor integration, real-time space tracking, payment processing, and reservation management.

Quick answer: Design a Parking Garage

Design a Parking Garage is covered here as a practical system design interview problem. Design a parking garage system with OOP modeling, sensor integration, real-time space tracking, payment processing, and reservation management. Use it to practice requirements, APIs, storage choices, scaling bottlenecks, data consistency, observability, and failure handling for a easy interview round.

Focus on the problem being solved, the main design choice, the failure mode, and the tradeoff you would defend in front of a senior engineer. This page is part of the DosiBridge system design knowledge graph, so it links related concepts, interview problems, tradeoffs, and references instead of leaving the topic isolated.

Diagram showing the key components and data flow in a Design a Parking Garage system design
High-level overview of Design a Parking Garage

Problem Statement

Design a parking garage management system that tracks available spaces in real time, handles vehicle entry/exit via sensors or ticketing, calculates fees based on duration and vehicle type, supports reservations, and manages multiple floors with different spot sizes (compact, regular, large, handicapped).

Requirements

System architecture diagram for Design a Parking Garage showing how services, databases, and caches connect
System architecture for Design a Parking Garage

Functional

  • Track real-time availability per floor and spot type (compact, regular, large, handicapped)
  • Handle vehicle entry: assign nearest available spot, issue ticket with entry timestamp
  • Handle vehicle exit: calculate fee based on duration and vehicle type, process payment
  • Support advance reservations with time-window holds

Non-Functional

  • Consistency: No double-booking of spots -- strong consistency required
  • Latency: Entry/exit gate processing <2 seconds
  • Availability: 99.9% -- gates must open even during partial system failure
  • Scale: Support 10,000-spot garages with 50,000 entries/exits per day

Core Architecture

Step-by-step diagram showing how Design a Parking Garage processes a request from start to finish
How Design a Parking Garage works step by step
  1. Spot Allocation Service -- Maintains an in-memory map of all spots and their states (available, occupied, reserved, maintenance). Uses a priority queue per floor to assign the nearest available spot to each vehicle type. Spot assignment is wrapped in a database transaction to prevent double-booking.

  2. Entry/Exit Gate Controller -- Interfaces with physical hardware: license plate cameras, ticket dispensers, barrier gates. On entry, requests a spot from the allocation service and issues a ticket. On exit, looks up the ticket, computes the fee, and lifts the barrier after payment.

  3. Payment Service -- Computes fees using a rate engine: first hour flat rate, then per-15-minute increments. Supports credit card, mobile pay, and prepaid passes. Integrates with Stripe/payment processor. Generates receipts and handles refunds for overcharges.

Comparison table for Design a Parking Garage contrasting approaches, tradeoffs, and when to use each
Comparing key aspects of Design a Parking Garage
  1. Reservation Manager -- Accepts advance bookings with a time window. Holds the reserved spot starting 15 minutes before the window. Unredeemed reservations release automatically after a grace period, triggering a no-show fee.

Database Choice

PostgreSQL is the primary database. Spots, tickets, and reservations all have strong relational integrity (a spot belongs to a floor, a ticket references a spot and a vehicle). Transactions ensure no double-booking. The spots table uses a status column with row-level locking on assignment. Redis caches the real-time availability counts per floor for the display boards and mobile app, updated via CDC from Postgres.

Interview preparation checklist for Design a Parking Garage with key points to mention and mistakes to avoid
Interview tips for Design a Parking Garage

Key API Endpoints

text
POST /api/v1/entry
  -> Body: \{ license_plate: "ABC123", vehicle_type: "regular" \}
  -> Returns: \{ ticket_id: "T-9001", spot: "F2-R34", floor: 2 \}

POST /api/v1/exit
  -> Body: \{ ticket_id: "T-9001", payment_method: "credit_card" \}
  -> Returns: \{ duration_min: 147, fee_usd: 12.50, receipt_url: "..." \}

Scaling Insight

For multi-garage chains, use a hierarchical allocation model: each garage runs its own Spot Allocation Service locally (so gates work even if the network is down), while a central service aggregates availability across all garages for the mobile app and reservation system. Local-first design ensures gates never block on a remote call.

Decision guide for when to choose Design a Parking Garage and when alternative approaches are better
When to use Design a Parking Garage

Key Tradeoffs

DecisionOption AOption BChosen
Spot assignmentRandom availableNearest to entranceNearest -- better user experience, reduces driving time inside garage
ConsistencyOptimistic lockingPessimistic row lockPessimistic -- simpler, spot contention is low enough that lock wait is negligible
Fee modelFlat hourly rateTiered per-minuteTiered -- fairer to short-stay visitors, higher revenue optimization

Original DosiBridge notes for Design a Parking Garage

This section is written specifically for this page, not copied from a general system-design checklist. The useful way to study Design a Parking Garage is to connect the concept to a production service where growth exposes the first weak assumption in the original design. That framing changes the design discussion from definitions to operating choices.

What makes this topic distinct

  • Core Entity: For Design a Parking Garage, decide the core entity before choosing tools; otherwise the design looks clean but fails when parking changes.
  • Read/Write Path: For Design a Parking Garage, decide the read/write path before choosing tools; otherwise the design looks clean but fails when garage changes.
  • Contention Point: For Design a Parking Garage, decide the contention point before choosing tools; otherwise the design looks clean but fails when parking changes.
  • Abuse Path: For Design a Parking Garage, decide the abuse path before choosing tools; otherwise the design looks clean but fails when garage changes.
  • Recovery Workflow: For Design a Parking Garage, decide the recovery workflow before choosing tools; otherwise the design looks clean but fails when parking changes.

Design a Parking Garage correctness boundary

For this problem, separate the user-visible action from background work. The correctness boundary is the smallest state transition that must not be duplicated, lost, or reordered. Naming that boundary makes the solution more original than a stock API/database/cache template.

Design a Parking Garage scaling bottleneck

The first bottleneck should be described in the language of this system: a hot timeline, a contested seat, a busy wallet ledger, a media-processing queue, or a search index update delay. That bottleneck decides which component deserves the deepest interview discussion.

Production review question

If Design a Parking Garage suddenly receives 10x traffic, which entity becomes contested first, and what queue, lock, shard, or cache protects that entity without hiding correctness bugs?

Practical metric to track

Track parking-garage health as a named dashboard or review item: combine one user-facing metric, one saturation metric, and one correctness metric. For Design a Parking Garage, this keeps the discussion grounded in behavior that can be measured after deployment instead of generic advice that sounds good in an interview but never gets verified.

Sources