Code RoomWorker pool concurrency spec
HardPrep Room Coding #3978

Worker pool concurrency spec

Vibe & agenticConcurrencySenior–Staff~20 min

You need a Go worker pool that processes a stream of jobs with a bounded number of goroutines, graceful shutdown on SIGTERM, and a cap on in-flight work. Write the spec you'd give an AI agent. Which concurrency guarantees must you spell out, and what does a casual 'write a goroutine worker pool' prompt get subtly wrong?

Implement
simulate_pool_shutdown(job_durations: list[int], worker_count: int, shutdown_at: int, grace_ticks: int) → list[int]
Examples
in[[5,5,5],2,100,10]out[3,0,0]
in[[10,10,10],1,15,0]out[1,1,1]
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 20 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.