OpenAI

Verified interview challenge

Implement a fault-tolerant work queue

Keep an in-memory job queue consistent through successful work, failures and expired reservations.

Unlock with Full Access

The challenge

Build an in-memory queue whose jobs can be reserved, succeed, fail or time out. Later requirements add dependencies, so a job's readiness depends on more than whether it has been enqueued.

Reason about ownership, retries and completion as operations advance the supplied clock. There is no real waiting or worker-thread setup, which keeps the exercise focused on whether the queue's state transitions are correct.

What you'll practise

  • Reservation lifecycle

    Keep retries and expired work consistent with completed and exhausted jobs.

  • Dependency eligibility

    Allow work to proceed only when the required prior jobs satisfy the contract.

Your coding workspacePreview
Current partFurther parts unlock as you progress
solution.pyPython 3.13
# Build on your implementation

# Run checks for the current part

# Full starter code included
Current-part checks

Run your code to see results.

The complete sequence, starter code and checks are included with Full Access.