Anthropic

Verified interview challenge

Build a resumable weighted data batcher

Produce weighted data batches whose sequence stays reproducible after saving and resuming.

Unlock with Full Access

The challenge

Start with batch sizes that divide cleanly into the required quotas. Extend the same batcher with checkpoint and resume, then handle sizes that do not divide evenly. A final written part asks how production edge cases affect the implementation, keeping the discussion grounded in the code you built.

What you'll practise

  • Weighted allocation

    Preserve the intended mix when quotas cannot all be exact integers in one batch.

  • Reproducible state

    Capture enough progress to resume the same sequence and explain its operating limits.

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.