Collision Risk for Six-Digit Amazon Locker Pickup Codes

Last updated: November 29, 2026

Quick Overview

Each active Amazon Locker parcel gets a random six-digit pickup code. If codes only need to be unique within one locker bank, how many active parcels can a bank hold before a duplicate code becomes likely, and what does that imply for code design?

Amazon
Statistics & Math
Software Engineer
Amazon
November 29, 2026
Software Engineer
Technical Screen
Statistics & Math
Medium

0

0

0 solved


Each active Amazon Locker parcel gets a random six-digit pickup code. If codes only need to be unique within one locker bank, how many active parcels can a bank hold before a duplicate code becomes likely, and what does that imply for code design?

A birthday-problem question in the style of an Amazon technical screen for engineers on Hub and Locker systems. The interviewer checks that you can quantify collision probability, use the square-root approximation, and turn the math into a design decision.

What the Interviewer Expects
  • Recognizes the birthday problem structure
  • Derives the $1 - e^{-n^2/2N}$ approximation
  • Finds the 50% point near $1.18\sqrt N$
  • Distinguishes a collision anywhere from a collision with one specific code
  • Proposes a design fix such as checking for uniqueness at issue time
Key Topics to Cover
birthday problem
collision probability
exponential approximation
code space sizing
security trade-offs
How to Approach This
  1. Define your hypotheses (H0 and H1) clearly before performing any test.
  2. Calculate required sample size BEFORE running an experiment, using power analysis.
  3. Remember the Central Limit Theorem: sample means become approximately normal with large n.
  4. Watch for Simpson's paradox. Always segment data by key dimensions.
  5. Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
  • What is the chance a guessed code opens some compartment?
  • How does the answer change for alphanumeric 6-character codes?
  • Why not use sequential codes?
  • How would rate limiting at the kiosk change the guessing risk?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Browse Statistics Questions
Sample Answer
Clarify

Code space N=106N = 10^6. A bank has nn simultaneously active parcels with independently random codes. I want P(at least two share a code)P(\text{at least two share a code}) as a function of nn....

Approach

The probability all nn codes are distinct is ∏i=0n−1(1−i/N)\prod_{i=0}^{n-1} (1 - i/N). Using 1−x≈e−x1 - x \approx e^{-x}, that is about e−n(n−1)/2Ne^{-n(n-1)/2N}. Set the collision probability to a target and solve for nn....


Submit Your Answer
Markdown supported