SevyDevy

Design an Amazon locker system

PremiumLow-level designHard

  • Resource allocation
  • State machine
  • OTP verification

Quick answer

This low-level design interview question asks you to design an Amazon locker 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

Amazon Locker system low level design: build the object model for a network of self-service parcel lockers at shops and stations. Couriers deposit packages into size-matched lockers, and customers collect them with a one-time code within 3 days. The hard parts are no double allocation, secure codes and expiry.

When a customer chooses locker delivery, the system reserves a locker of the right size at the chosen location. A courier opens the reserved locker, deposits the package and closes it. The customer receives a one-time code, opens the locker within 3 days and takes the package.

Unclaimed packages are collected by a courier and returned. Customers can also use a locker to return an item.

What must an Amazon locker system do?

  • Locations and lockers: A location has many lockers of sizes small, medium, large and extra-large, each with a status (free, reserved, occupied, out of order).
  • Reserve: When an order is placed, reserve the smallest free locker that fits the package dimensions at the location; refuse with a reason if none fits. A reservation expires if no deposit happens within 2 days.
6 more requirementsUnlock to see all

How well must it do it?

  • No double allocation: Two orders must never reserve the same locker, even when the website and the kiosk act at the same time.
  • Secure codes: Codes must be unguessable within the attempt limit (5 wrong attempts lock the package for 1 hour) and never stored in plain text on the kiosk.
3 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

  • Resource allocation
  • State machine
  • OTP verification
  • Strategy pattern
  • Expiry scheduling
  • Concurrency

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 an Amazon locker system and explain your choices the way you would in an interview.
Is this question asked at entry level?
It is marked Hard. It suits engineers preparing for senior interviews, where you are expected to drive the discussion and go deep on trade-offs.
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