← Questions
Design Amazon Locker: a package pickup locker network
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Design a self-service package locker network. At checkout a customer picks a locker location; when the package arrives, the system assigns a compartment big enough for it and sends the customer a code. The customer has a few days to collect it, after which it is returned.
Requirements
- Functional: show nearby locker locations with free capacity at checkout; reserve capacity for an order; assign a compartment of the right size when the driver arrives; generate a one-time pickup code; open the compartment for a valid code; handle expired pickups and returns; support drivers loading many packages at once.
- Non-functional: a compartment is never given to two packages; lockers keep working when their network connection drops; codes are hard to guess; status is accurate enough for checkout to rely on.
Clarifying questions
- How many locations and compartments, in how many sizes?
- When is a compartment reserved: at checkout or at delivery?
- How long does a customer have to collect, and what happens after?
- Can customers return items through the locker too?
- What hardware and connectivity does a locker have?
What a strong answer covers
- A data model: locations, compartments with size and state, reservations, deliveries, pickup codes.
- Capacity planning at checkout by size class per location and day, separate from assigning a physical compartment at delivery.
- Compartment assignment: smallest compartment that fits, with an atomic state change so two deliveries cannot take the same one.
- The locker as an edge device: a local state copy and code list so it works offline, syncing events to the backend afterwards and resolving conflicts.
- Code generation and verification, rate limiting of attempts, and audit of door openings.
- Expiry jobs that schedule returns, notifications to customers, and monitoring of hardware faults.
Follow-ups
- A package does not fit the compartment assigned to it.
- A locker is offline for a day while customers keep collecting.
- A location fills up during the holidays. How do you avoid sending customers to a full locker?
- Add returns: a customer drops off an item for a refund.
Sign in to see the worked answer
The full answer, chapter by chapter, with what interviewers expect at each level. Free with an account: one full answer per company.
What the labs asked this week
A weekly email of what OpenAI, Anthropic and the other top AI labs asked engineers, round by round.
Sign in to see the worked answer
The full answer, chapter by chapter, with what interviewers expect at each level. Free with an account: one full answer per company.
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing

