Implement HTTP Route Matching for a Web Framework
Implement two functions, `registerHandler(pattern)` and `getHandler(path)`, that form the core routing logic of a web framework. `registerHandler` adds URL patterns (which may include `{parameter}` placeholders) to the router, while `getHandler` matches an incoming request path against registered patterns and returns the matching pattern or null if none exists.
Asked at:
Google
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Early September, 2026
Staff
Early September, 2026
Staff
Late August, 2026
Mid-level
Hello Interview Premium
Your account is free and you can post anonymously if you choose.