Model the Classes for a Store Pickup Locker System
Last updated: November 29, 2026
Quick Overview
Design the object model for the self-service pickup lockers in Walmart stores: compartments of different sizes, depositing an online order into the best fitting free compartment, retrieving it with a one-time code, and expiring uncollected orders.
Walmart Labs
November 29, 20260
0
0 solved
Design the object model for the self-service pickup lockers in Walmart stores: compartments of different sizes, depositing an online order into the best fitting free compartment, retrieving it with a one-time code, and expiring uncollected orders.
Walmart stores have pickup towers and lockers that hand online orders to customers without an associate. In the Walmart Labs low-level design round the interviewer checks class responsibilities, a sensible allocation policy, secure codes and clean handling of expiry.
What the Interviewer Expects
- Identify the core classes and their responsibilities
- Choose and justify a compartment allocation policy
- Generate unguessable pickup codes and make them single use
- Handle expiry and returning uncollected orders
- Keep the design extensible to new sizes or locker types
Key Topics to Cover
How to Approach This
- Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
- Choose data structures based on access patterns, not familiarity.
- Prefer immutable data and message passing over shared mutable state for concurrency.
- Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
- How would you persist state so a power cut does not lose which compartment holds what?
- How would you reserve a compartment before the order is even picked?
- Smallest-fit can leave large packages with nowhere to go; what policy would you use instead?
- How would you support refrigerated compartments for grocery orders?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Compartments come in small, medium and large. An associate deposits an order with a package size; the system picks a free compartment that fits and returns a pickup code. The customer enters the code ...
High-Level Design
Size is an ordered enum, so fit is comp.size >= package_size. Compartment owns its id, size and current order. PickupLocker owns the compartments and an index from code to `(compartment, expir...