Preparing your design workspace

Loading the problem and your latest saved attempt…

Concurrent Worker Processing Platform

Extend a queue-backed worker service to raise throughput safely with leases, concurrency budgets, retries, backpressure, and observable terminal outcomes.

Problem statement

For this exercise, assume an existing service durably accepts registered background task types, places task references on one queue, and uses a fixed worker pool. Extend it for higher concurrency and throughput while preserving understandable failure behavior.

A client submits an immutable task with a tenant-scoped idempotency key, then reads queued, running, retrying, succeeded, permanently failed, or dead-lettered status. Queue delivery is at least once. An execution attempt owns only a time-bounded fenced lease; a stale worker must not overwrite a newer outcome.

Independent tasks may run in parallel, but tasks declaring the same resource key must not hold overlapping valid execution authority, and tenant and downstream concurrency budgets must prevent one workload from exhausting shared capacity.

Assume peaks of 25,000 task submissions per second, bursts that create a one-million-task backlog, and task durations from 100 milliseconds to ten minutes.

Start 95 percent of ready tasks within five seconds under normal capacity, retain terminal status for 30 days, and recover from a worker, queue partition, or availability-zone failure.

Design the contracts, task state, queue and worker topology, scaling controls, retry and dead-letter policy, bottleneck diagnosis, backpressure, and recovery. Future schedules, dependency graphs, cancellation, arbitrary user code, and the business logic inside registered handlers are outside scope.

What to build

  1. A client can idempotently submit one immutable registered task and receive a durable task identifier or an explicit rejection.
  2. The platform dispatches ready work in parallel while enforcing resource-key exclusion and tenant and downstream concurrency budgets.
  3. Workers execute under fenced leases, report outcomes, and recover retryable work after duplicate delivery, lease expiry, or infrastructure failure.
  4. Clients and operators can observe task progress, retries, terminal results, dead-letter state, backlog health, and capacity pressure.

At scale

  • For this exercise, assume peaks of 25,000 task submissions per second, a burst backlog of one million tasks, and task durations ranging from 100 milliseconds to ten minutes.
  • For this exercise, start 95 percent of ready tasks within five seconds under normal capacity, and expose oldest-ready age when overload violates that objective.
  • For this exercise, queue delivery is at least once; stable task identity, fenced attempts, and handler idempotency or reconciliation must converge retries on one authoritative outcome.
  • For this exercise, retain terminal status for 30 days and recover accepted work after a worker, queue-partition, or availability-zone failure without allowing a hot tenant or slow dependency to consume all concurrency.