S01 · The Bootsector · L-02

Bounded Ring Buffer

Difficulty
easy
Type
generation
Session
Standard
Stack
Go go1.22
Domain
Data Pipelines
Est. solve
~25 min

01 · The task

Bring an empty bounded FIFO queue to life: Push and Pop over a fixed capacity that stay correct when many goroutines hammer it at once. The signatures and public tests ship in the kit — the blocking and safety semantics are yours to pin down.

02 · Constraints

  • Thread-safe

    Must be correct under concurrent producers and consumers.

  • No external dependencies

    Solve it with the standard library only.

03 · Skills exercised

concurrency-primitivesMutexes, condition variables, and queues that make shared state safe.api-designDesigning a small, clear interface: the signatures and contracts callers depend on.

How to playDaemon

The whole level runs through the local promptly daemon — it pulls the workspace, captures your token usage, tests locally, and submits the ranked run.

  1. Pair this machine

    One-time — approve the code under your devices.

    promptly pair
  2. Pull the workspace

    Downloads the starter kit into ring/ and starts the solve clock — cd in before the next step.

    promptly init ring
  3. Start the captured session

    Then drive your AI tool — the daemon meters every prompt and token live.

    promptly start
  4. Submit for ranked grading

    Runs the full hidden suite and ends the attempt.

    promptly submit

Or combine steps 02–03 into one commandShortcut

promptly play pulls the workspace, launches the daemon, and starts the captured session in a single step — the same as running init then start. Then cd ring and drive your harness.

promptly play ring