PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/System Design/Amazon

Design locker allocation service

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's understanding of stateful system design, resource allocation strategies, concurrency control, API and data modeling, and fault tolerance in the context of real-time locker assignment.

  • hard
  • Amazon
  • System Design
  • Software Engineer

Design locker allocation service

Company: Amazon

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Technical Screen

Amazon Locker OS provides a set of LockerIDs. Locker and package sizes are Small, Medium, and Large. Each locker may hold at most one package. Design the component that manages the set of lockers and returns the best-fitting LockerID when a courier arrives with a package. Clearly define "best fit" (e.g., prefer exact size; allow upsizing rules and their priority). Specify core operations (register lockers, mark available/occupied, assign, release on pickup, query status), data structures, and time/space complexity. Address concurrency (simultaneous couriers), idempotency and retries, race conditions, and fairness/starvation. Describe persistence and failure recovery. Provide APIs, schema, and pseudocode for assign(packageSize) and release(lockerId). Consider extensions such as reservations, per-location sharding, priorities/SLA tiers, and scaling.

Quick Answer: This question evaluates a candidate's understanding of stateful system design, resource allocation strategies, concurrency control, API and data modeling, and fault tolerance in the context of real-time locker assignment.

Related Interview Questions

  • Design Human Avoidance for Warehouse Robots - Amazon (medium)
  • Design a Ride-Hailing Matching System - Amazon (medium)
  • Design a replicated cloud storage service - Amazon (hard)
  • Design a cloud database write path and recovery - Amazon (hard)
  • Review an existing architecture for risks - Amazon (medium)
Amazon logo
Amazon
Sep 6, 2025, 12:00 AM
Software Engineer
Technical Screen
System Design
2
0

Design a Best-Fit Locker Assignment Component

Context

You are designing the locker-assignment component for a Locker OS used at physical locker banks (one or more locations). Lockers and packages have sizes: Small (S), Medium (M), Large (L). Each locker holds at most one package. Couriers arrive with packages and need to be assigned the best-fitting LockerID quickly and safely under concurrency.

Assume:

  • The component may run per location (preferred) or centrally with per-location sharding.
  • Locker devices report available/occupied states; the service is the source of truth for assignment decisions.

Requirements

Design a component that:

  1. Returns the best-fitting locker for a given package size.
  2. Defines a clear "best fit" policy (exact match preferred; upsizing rules and priorities).
  3. Exposes core operations:
    • Register lockers
    • Mark locker available/occupied/broken
    • Assign locker to package (for courier)
    • Release on pickup
    • Query status and counts
  4. Specifies data structures and time/space complexity.
  5. Addresses concurrency (simultaneous couriers), idempotency and retries, race conditions, fairness/starvation.
  6. Describes persistence and failure recovery.
  7. Provides APIs, schema, and pseudocode for assign(packageSize) and release(lockerId).
  8. Considers extensions: reservations, per-location sharding, priorities/SLA tiers, and scaling.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Amazon•More Software Engineer•Amazon Software Engineer•Amazon System Design•Software Engineer System Design
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.