Skip to main content
PreparationZone Logo
PrepZone

Design an Amazon Locker System

Compartment allocation, OTP pickup, and expiry.

Pass checkpoint below

Read these first

Why this matters

  • Delivery agent assigns package to compartment by size (S/M/L)
  • Scope — what "Compartment sizing" covers inside Amazon Locker System and what it does not
  • Scope — what "Pickup flow" covers inside Amazon Locker System and what it does not
  • Scope — what "Expiry" covers inside Amazon Locker System and what it does not
  • Machine problems test State, Strategy, and facade coordination.
Client / API
FacadeSingle entry point
EntitiesDomain objects
State / Strategy
Most LLD machines expose a facade that coordinates entities and state transitions.

CampusOS context

CampusOS is the fictional smart-campus platform used across this track. Treat this module as a real product slice:

Context

  • Belongs to CampusOS — same naming and design vocabulary as parking, library, and booking modules
  • Scope is one JVM — persistence is in-memory or behind a repository interface
  • Goal is a class diagram + core Java that an interviewer can follow in 35–45 minutes
  • Extension paragraph at the end links to System Design when scale exceeds one process

Requirements snapshot

Functional requirements

  • Delivery agent assigns package to compartment by size (S/M/L)
  • System generates one-time pickup code sent to customer
  • Customer enters code at kiosk; compartment opens if valid and not expired
  • Expired packages free compartment and notify customer
  • Support multiple locker banks per city with unique bank ID

Non-functional requirements

  • Single JVM, in-process design for this LLD article
  • Core flows testable with in-memory repositories
  • Extension points for new rules without editing central god classes
  • Clear public API on facade/service layer
  • CampusOS extension links to System Design when scale demands distribution

The rest of this guide is part of Pro

Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.

Still to come · 6 sections

  • Overview
  • Requirements
  • Compartment sizing
  • Pickup flow
  • Expiry
  • CampusOS extension

Test yourself

Answer these before moving on — recall is what makes it stick.