Design Amazon Locker System
Problem Statement
Design the Low-Level Design (LLD) of an Amazon Locker System, which allows customers to pick up or return packages from self-service lockers instead of home delivery.
The system should manage locker allocation, package storage, pickup, return, and locker status tracking efficiently, while ensuring security and timely delivery.
Your goal is to focus on object modeling, class interactions, and state management, not large-scale distributed architecture.
π― Goal
Design a system that can:
β Functional Requirements
1. Locker Setup
Available
Occupied
Out of Service
2. Package Delivery (Courier Flow)
3. Customer Pickup Flow
4. Package Return Flow (Optional)
5. Locker Timeout
βοΈ Non-Functional Requirements
π§± Key Classes to Design
ClassResponsibility
AmazonLockerSystem
Main orchestrator; manages locker locations, packages, and operations.
LockerLocation
Represents a location with multiple lockers.
Locker
Represents an individual locker unit (id, size, status).
Package
Represents a parcel to be stored or delivered.
LockerManager
Handles locker allocation, release, and status updates.
NotificationService
Sends pickup codes and alerts to customers.
AccessCode
Represents OTP or code for locker access.
User
Represents customer or courier.
TimerService
Handles locker timeout or expiry logic.
π§© Example Class Relationships
1
2AmazonLockerSystem
3 βββ List<LockerLocation>
4 βββ allocateLocker(Package)
5 βββ releaseLocker(AccessCode)
6 βββ sendNotification(User, AccessCode)
7
8LockerLocation
9 βββ String id
10 βββ Address address
11 βββ List<Locker>
12
13Locker
14 βββ String id
15 βββ LockerSize size
16 βββ LockerStatus status
17 βββ Package package
18 βββ AccessCode code
19
20Package
21 βββ String trackingId
22 βββ LockerSize size
23 βββ User recipient
24 βββ Date deliveryTimeπ Example Flow
π§Ί Package Delivery
1
2Your package is ready for pickup!
3Locker: L-07, Location: HSR Layout, Code: 493201πͺ Customer Pickup
π§Ύ Example Input / Output
Input:
1
2Package: ID=P123, Size=MEDIUM, Customer=Sahil
3LockerLocation: HSR LayoutOutput:
1
2Locker Allocated: L-07
3Pickup Code: 493201
4Pickup Expiry: 48 hoursπ Concurrency & Safety
π§ Possible Extensions
β Summary:
Design a Locker Management System (LLD) that:
Focus on object modeling, locker allocation logic, and secure access handling.