Skip to Content

Design a reservation and payment system for a parking garage

Home | Coding Interviews | System Design | Design a reservation and payment system for a parking garage

Design a reservation and payment system for a parking garage. Functional requirements include "spot booking", the ability to make payments, prevent booking the same parking spot, different classes of parking spots (compact,regular,large vehicles, handicap) with different prices. The non functional requirements include high consistency and availability.

Designing a reservation and payment system for a parking garage requires handling both the functional and non-functional requirements.

For functional requirements, the system needs to allow users to book parking spots based on availability and vehicle type (compact, regular, large, handicap). A database would track available spots in real-time, ensuring no double-booking. Different prices for various spot types can be implemented with price tiers. Payment functionality needs integration with a secure payment gateway, storing transactions safely. The system should also handle cancellations and modifications, refunding or charging accordingly. A user-friendly interface (e.g., web or mobile) will let customers view availability, book, and pay for spots.

On the non-functional side, high consistency is crucial for preventing race conditions when booking spots—this can be achieved using strong database constraints and locking mechanisms. Availability is equally important, meaning the system should handle downtime gracefully and scale horizontally. Techniques like caching (e.g., Redis for fast spot availability lookups), database replication, and load balancing will help maintain high uptime. Ideally, the system should also ensure quick response times for querying spot availability and processing payments, while being secure to prevent data breaches.

Posted by grwgreg 4 months ago

Related Problems

A video service (like youtube) has many viewers watching videos. Given a stream of the video IDs that are being watched, we need to find the top K most viewed videos for different periods of time (1 hour, 1 day, 1 month, all time). For the top K videos returned, we also want the count of views during this period.

Design an app like google maps. The app should provide the quickest possible route between two arbitrary locations. It should provide an ETA, estimated time to reach a destination, using current traffic data.

Sending user notifications is a common requirement in system design. Design a notification service for an organization. The system will use shared services for the underlying messaging implementation (email, sms, push notifications, etc) so the actual messaging implementation does not need to be designed. The system should support a user publishing a notification to a single user or groups of users. Notifications can be triggered manually via a web UI or programmatically via an API. Users should be able to view their past notifications they published. If a user is unable to receive a notification, they should still receive it at the next opportunity and not miss the message. The notification service should scale to billions of notifications per day, with messages delivered within a few seconds, with five 9s uptime.

Design a url shortener service (similar to tinyurl).

1. Generate expiring unique short URL from provided URL

2. Redirect users to the correct website when they navigate to the short URL