Back to problems

URL Query Parameter Parsing

Algorithm · Airbnb · Medium

You are building a web service that handles HTTP GET requests. Each URL may contain a query string, which is the portion that follows the first question mark '?'. Your job is to extract the parameters from the query string and return a dictionary that maps each key to its associated value. Apply the following rules when parsing: Extracting keys and values: For every occurrence of key=value, record the entry key: value in the output. Example: the query string…

Checking your access…