Log inBook a Demo
BuildMidBackendAuto-graded

Patch a filter that forgets items you added

Tests whether someone can debug a space-saving shortcut that may raise false alarms but must never miss a real match.A Bloom filter makes one hard promise: anything you add must always report as present. False positives are allowed — that is the trade you make for the space saving — but a false negative means the structure is simply broken. The BloomFilter in bloom.py forgets items it was given. Find why its bit positions go wrong and repair it, keeping the false-positive rate where the size and hash count say it should be.
35 min
python

You're done when

  • Nothing that was added is ever reported missing — no false negatives, for any input.
  • That holds for raw byte inputs too, not only strings.
  • The false-positive rate stays low, in line with the filter's size and hash count.

What it measures

Data structures and algorithmsDeriving several independent hash positions from one item and mapping them into a fixed bit array without bias or overflow.
Algorithm designUnderstanding which guarantee a probabilistic structure actually makes, and which failure is acceptable versus fatal.
Reasoning about invariantsTreating 'no false negatives' as the property to protect, and testing against it rather than against a handful of examples.

Your environment

Terminal + editorA full shell in the browser
Claude CodePre-authenticated, no key setup
Isolated microVMYours alone, wiped afterwards

Start this lab

35 min
Start labYou'll sign in to Anthropos to start. The lab opens in a private cloud workspace with Claude Code ready to use.
AI Labs is part of Anthropos Workforce. Not on your plan yet? Book a demo