Skip to the guide

Design parcel lockers (like Amazon Locker)

IntermediateCase study11 pages

The interviewer asks you to design the software for a wall of parcel lockers. Picture a hotel porter and the luggage room. He puts each bag on the smallest shelf it fits and gives the guest a numbered stub. If nobody comes within three days, the stub stops working, but the bag still sits on its shelf until someone carries it to lost property.

The closest other case study is the parking lot, and half of this design is the same: a free stack for each size, and a list of sizes that fit. What's new is that the person who collects isn't there when the parcel arrives, so they need a code, and that the code ends on a clock while the parcel doesn't vanish. Interviewers like it because a candidate who copies the parking lot misses both.

Below is a full 45-minute round on the LLD framework. At each Guess before you read on, stop and answer first. The full runnable project is a download in Java, JavaScript and Python.

Run the full project

This design as a project you can run, with its tests and a demo. You only need Java 21, Node 24 or Python 3.13. The README says how to run it.

Step 1 · Clarify the requirements and cut the scope

Minutes 0–5 · How this step works

Interviewer: Design a parcel locker system.

You: What sizes are there, and can a small parcel take a bigger locker?

Interviewer: Small, medium and large. Yes, if its own size is full, and never the other way round.

You: How does the customer open the locker?

Interviewer: The courier deposits the parcel, and the customer gets a six-digit code to type at the screen.

You: How long does the code last, and what then?

Interviewer: Three days. After that a courier takes the parcel back.

You: How big is it, and is there a payment?

Interviewer: One bank of about 200 lockers, and no payment.