Problem statement
Design the object model and public APIs for a reservation engine that books arbitrary resource types (equipment, vehicles, lab instruments) for time ranges, enforcing per-resource conflict rules and per-requester usage quotas from a single reusable core.
Operating context. The system manages a catalog of resources of different types, each with a conflict rule: some are exclusive (one booking per time range), some allow limited concurrent use up to a count (N shared licenses). A requester reserves a resource for a time range; the engine grants it only if the conflict rule and any per-requester quota (max active reservations, max hours per week) allow. Reservations can be cancelled, freeing capacity. Concurrent requests must not exceed a resource's allowed concurrency. Single-process, one wall clock.
Out of scope. Pricing and billing, approval workflows, the REST surface, physical access control, and persistence (assume in-memory for v1).
What to produce. The class hierarchy (Resource, conflict-rule strategy, quota policy, Reservation, engine service), each class's public API, and the reservation state machine (requested → confirmed → cancelled / completed). Be explicit about: how the conflict rule is abstracted so exclusive and shared-count resources share one code path, how per-requester quotas are pluggable and composable, and how concurrent grants never exceed a resource's allowed concurrency.
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
- Oop Generics
- Concurrency Locks