Problem statement
Design the object model and core APIs for a car-rental system that an agency runs across several branch locations, where customers reserve a vehicle of a chosen category, pick it up, and later return it.
Operating context. The agency owns a fleet spread over a handful of city branches. Each vehicle belongs to a category (economy, sedan, SUV, van, luxury) and lives at a home branch, though a customer may pick up at one branch and drop off at another. A customer searches for an available vehicle in a category for a date range, reserves it, presents the reservation at pickup, and settles the bill at return. Pricing depends on category, rental duration, and season, and the total may accrue extra charges at return (late return, refuelling, recorded damage). The whole thing runs as a single in-process service; several booking desks operate concurrently.
Out of scope. Persistence and ORM mapping (assume an in-memory repository for v1), the payment-gateway integration itself (model where a charge is applied, not the network call), the HTTP/REST surface, insurance underwriting, and geographic routing between branches.
What to produce. The class hierarchy (entities, value objects, services), the public API each class exposes, and the state transitions for a reservation and for a vehicle. Be explicit about: how availability for a category over a date range is computed across branches, how two desks reserving the last car in a category do not double-book it, how the pricing rule is swappable (seasonal or weekend tariffs) without touching the reservation flow, and how a new fee type (e.g. a cleaning fee) or a new vehicle category is added as a localised change.
Requirements
This assessment is a Premium feature.
The statement above is free to read. The functional and non-functional requirements, and the graded canvas that scores your design against them, come with Premium.
Topics
- System Design LLD
- Oop Solid
- Patterns Strategy
- Patterns State
- Concurrency Locks