Back

Inventory Allocation by Bid Priority

OAAsync OALast reported August 2026Low Frequency

Problem Overview

The round: the coding half of Amazon's online assessment, next to an AI-assisted task in a code repository. Three candidates had it between June and August 2026: a new grad, an SDE II applicant who rated it medium to hard, and one who only gives its title, "Inventory Allocation by Bid Priority". The rules and the example below come from the new grad's report, the only one that describes the problem. No constraints were posted, and the function name is ours.

Problem

requests[i] = [customerId, quantity, bidAmount, timestamp], and totalInventory items are available. Allocate items by these rules:

  • A higher bidAmount has higher priority. Lower bids are considered only after every higher bid has been processed.
  • Customers with the same bidAmount are served round-robin in order of increasing timestamp: in each round a customer receives at most one item, until their quantity is met or the inventory runs out.

Return the IDs of the customers who receive no items.

def getUnallocatedCustomers(requests: list[list[int]], totalInventory: int) -> list[int]: ...

Example (as reported)

requests = [[1, 5, 5, 0],
            [2, 7, 8, 1],
            [3, 7, 5, 1],
            [4, 10, 3, 3]]
totalInventory = 18
Output: [4]

Bid 8: customer 2 gets all 7 (11 left). Bid 5: customers 1 and 3 share the 11 round-robin, both get some. Bid 3: nothing is left for customer 4.

The report does not say in what order to return the IDs. The tests sort your list before comparing, so any order passes.

What Reports Emphasize

What candidates report: One new-grad report gives the full rules and an example; one other report gives only its title, and another describes it as allocation by priority, medium to hard.

Outcomes: The SDE II applicant who rated it medium to hard was invited to a phone screen the day after the OA.

Our note (not from the reports): Only the first round of each bid level decides who gets nothing. Ask about the output order and about timestamp ties; the report settles neither.

Practice

Write your own against 6 test cases, or read the worked solution — approach, complexity, and code that runs.

Prepping for Amazon with friends?

Send them this page. It is free to read, no account needed.

More Amazon Questions

Free preview

Every question in the Amazon catalog gets this depth

What you just read — canonical solution, follow-up arc, what passing candidates actually did — exists for all 57 Amazon questions, refreshed monthly from new candidate reports.

$59/mo — or $50/mo with the 3-month pass · cancel anytime
Amazon · OA · Reported 3× across candidate reports
Is this helpful?