BuildMidBackendAuto-graded
Build a URL matcher with params and wildcards
Tests precise matching rules and the right choice when more than one rule could claim the same address.Implement the route matcher at the core of every web framework: resolve a method and path to a handler plus the captured parameters. Patterns are slash-separated, and each segment is either a literal, a named parameter matching exactly one segment, or a wildcard matching the rest of the path. The subtleties are precedence and order-independence — a static segment must win over a parameter, whatever order the routes were registered in.35 min
python
You're done when
- The reference set of routes and paths resolves to the expected handlers and parameters.
- Matching does not depend on the order routes were declared in.
- A static segment takes precedence over a named parameter that would also match.
- The HTTP method is enforced — a matching path with the wrong method does not resolve.
- Named parameters and wildcards are extracted correctly into the returned parameters.
- A path matching no route returns no match rather than raising.
What it measures
API designImplementing routing semantics that framework users depend on, precedence included.
Algorithm designMatching patterns against paths deterministically, independent of declaration order.
Specificity rulesGetting static-over-parameter precedence right, which is the difference between a router and a pile of guesses.
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