SevyDevy

Design a car rental system

PremiumLow-level designMedium

  • Booking systems
  • Overbooking prevention
  • Resource assignment

Quick answer

This low-level design interview question asks you to design a car rental system. Aim for a design that is modelled as clear classes, interfaces and relationships that can handle new requirements without a rewrite. Interviewers want to see how you name responsibilities, keep classes small and reason about change.

The problem

Car rental system low level design: build the object model for a rental company with many branches, where customers reserve a vehicle category and get a specific car at pickup. The hard part is never overbooking while one-way rentals move cars between branches and maintenance takes them out of service.

A customer searches for a vehicle category at a branch for a date range, reserves one, picks it up after a licence and deposit check, drives it, and returns it to the same or another branch. Cars are not fixed to a branch: a one-way rental leaves the car at the drop-off branch, and cars leave service for planned maintenance and damage repairs.

The company tracks each vehicle's mileage, fuel and damage, prices rentals by category and duration, sells add-ons such as insurance and a child seat, and charges late fees.

What must a car rental system do?

  • Search: Given a pickup branch, a return branch, a category and pickup and return dates, return how many vehicles of that category the branch can still promise for every day of the range.
  • Reserve: Reserve a category, not a specific vehicle. Reservations can be modified or cancelled, with a fee inside 24 hours.
6 more requirementsUnlock to see all

How well must it do it?

  • No overbooking: Reservations of a category at a branch on any day must not exceed the unblocked vehicles expected there, counting one-way arrivals and departures, even with concurrent reservations.
  • Fast availability: A search over a 10-day range must not scan every reservation or every vehicle's history.
2 more requirementsUnlock to see all

What scale should you design for?

Use these numbers in your estimates.

The scale numbers unlock with this questionUnlock

Key concepts

  • Booking systems
  • Overbooking prevention
  • Resource assignment
  • State machine
  • Strategy pattern
  • Inventory management

How you’ll practise

6 short steps · save and come back any time
  1. Requirements
  2. Core objects
  3. Class relationships
  4. Key flows
  5. Extensibility
  6. Wrap-up

Lala, personalized to you, gives a hint when you ask and reviews your design when you are ready.

What do interviewers look for?

In any low-level design round.

  • Lists the use cases before writing classes
  • Gives each class one clear responsibility
  • Uses interfaces where behaviour is likely to change
  • Applies a design pattern only when it solves a real problem
  • Handles edge cases and invalid states explicitly
  • Walks through one use case end to end with the model

Questions people ask about this interview question

Which design type is this question?
It is a low-level design question. You design a car rental system and explain your choices the way you would in an interview.
Is this question asked at entry level?
It is marked Medium. Entry-level engineers can practise it, but it expects you to reason about requirements and trade-offs, not only list components.
What should I cover first?
Start with the use cases and the core entities, then the responsibilities of each one. Agree on scope with the interviewer before you design anything.
Can I practise it for free?
It is a premium question. Sign up and unlock it once for 10 credits; it then stays unlocked. When you finish, Lala, your personalized AI mentor, can review your design for 30 credits.

Related questions

Updated · Written by the SevyDevy team

Premium questionSign up free, then unlock it