Back to problems

URL Router Design

Object-Oriented Programming · Atlassian · Medium

Problem Design a URL router that associates handler function names with registered URL patterns. The router must handle exact path matching and also support the '' wildcard, which can appear inside any segment of a pattern. A '' matches exactly one complete segment in an incoming URL path. When a query arrives, the router should return the handler name tied to the most specific pattern that matches: Choose the pattern with the fewest wildcard segments. Return an empty string…

Checking your access…