Log inBook a Demo
BuildMidBackendAuto-graded

Fix a glob matcher that flags wrong files

Tests whether someone hunts down the rare cases where almost-correct file-matching rules quietly select the wrong files.A build tool's path-matching helper is flagging files it should ignore and ignoring files it should flag, and CI is suffering for it. match(pattern, name) is meant to behave like shell and .gitignore globbing within a single path segment: * for any run of non-separator characters including empty, ? for exactly one, and character classes with ranges and negation. Make it correct against SPEC.md — and implement the matching rather than delegating to a library that already does it.
40 min
python

You're done when

  • * matches any run of characters within a segment, including the empty run, and never crosses a separator.
  • ? matches exactly one character, and never a separator.
  • Character classes work, including ranges and negated sets.
  • ** spans zero, one or many whole path segments, exactly as SPEC.md specifies.

What it measures

Data structures and algorithmsImplementing wildcard matching with backtracking that terminates and stays correct on adversarial patterns.
Test case designExercising the empty match, the negated class and the separator boundary, which is where glob implementations usually fail.
Working to a specificationMatching a written contract precisely instead of approximating familiar behaviour from memory.

Your environment

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

Start this lab

40 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