def getUnallocatedCustomers(requests: list[list[int]], totalInventory: int) -> list[int]:
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:
bidAmount has higher priority. Lower bids are considered only after every higher bid has been processed.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.
The new-grad candidate received this OA about four months after the new-grad role opened in February, as one of two coding tasks (the other was an AI-assisted web-app task, in Django for Python), followed by a work simulation in an email-style interface and a work-style survey. An SDE II applicant rated it medium to hard and was invited to a phone screen the next day.
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:
bidAmount has higher priority. Lower bids are considered only after every higher bid has been processed.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 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.
Send them this page. It is free to read, no account needed.
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.