Durable Work Queue with Dependencies
Problem statement
Simulate an at-least-once work queue with retry limits, reservation timeouts, a dead-letter queue, and job dependencies. Start at time zero with no jobs, and return one result string for every operation.
The problem statement continues
ProExamples
Example 1
operations = ["ENQUEUE a 5 1 -","ENQUEUE b 3 0 a","RESERVE b","RESERVE a","ADVANCE_TIME 5","RESERVE a","PASS a","RESERVE b","PASS b","GET_DLQ"]return = ["OK","OK","UNAVAILABLE","OK","OK","OK","OK","OK","OK","EMPTY"]Job a times out once, succeeds on its retry, and then unlocks dependent job b.
FastPrep Pro
Reported in 1 OpenAI interview this weekUnlock this recently reported problem
FastPrep Pro gives you full access to interview problems reported within the last week.
- Full problem statement and constraints
- 1 more worked example, explained
- Guided hints and editorial
- Run your code on real test cases
$8.25/month
$99 billed yearly — or $19 month-to-month. Cancel anytime.
Free plan — 2 of 2 free unlocks used this week