Allocate Limited Sneaker Stock in a Randomised Launch Draw

Last updated: November 29, 2026

Quick Overview

Members enter a sneaker launch draw with up to two size preferences in priority order. Given the entries (possibly with duplicate entries per member) and stock per size, randomly order the unique members with a reproducible seed and give each member their first preference that still has stock, returning winners and a waitlist.

Nike
Coding & Algorithms
Software Engineer
Nike
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Medium

0

0

0 solved


Members enter a sneaker launch draw with up to two size preferences in priority order. Given the entries (possibly with duplicate entries per member) and stock per size, randomly order the unique members with a reproducible seed and give each member their first preference that still has stock, returning winners and a waitlist.

In the style of a Nike coding round for teams near SNKRS, where hyped launches run as draws instead of first-come checkouts. The interviewer wants a correct allocation, a clear fairness argument (arrival time must not matter), deterministic replay for audits, and attention to duplicate or bot entries.

What the Interviewer Expects
  • Deduplicates to one entry per member and states which entry is kept
  • Removes arrival-order bias before the shuffle so early entrants gain nothing
  • Uses a seeded RNG so the draw can be replayed and audited
  • Implements first-available-preference allocation (random serial order) correctly
  • Analyses complexity and discusses fairness properties
Key Topics to Cover
Randomisation
Fisher-Yates shuffle
Greedy allocation
Fairness
Determinism
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • Is a member with two preferences more likely to win than one with a single preference? Is that fair?
  • How would you run this over 5 million entries across several machines while keeping it reproducible?
  • How would you weight odds for members with strong engagement without making the draw feel rigged?
  • Winners have 30 minutes to pay. How do you reallocate unpaid pairs from the waitlist?
Sharpen Your Skills on Codemia

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

Practice DSA Problems
Sample Answer
Requirements

Input: entries as a list of (member_id, [pref1, pref2]) in arrival order, stock as a dict size to units, and a seed. One entry per member (keep the first, ignore later duplicates). Each member...

High-Level Design
  1. Deduplicate. 2. Sort by member id so the pre-shuffle order does not depend on arrival time or network jitter; otherwise replaying from a differently ordered log would change winners. 3. Shuffle wit...

Submit Your Answer
Markdown supported

Related Questions