Skip to content

Instantly share code, notes, and snippets.

Created February 6, 2020 19:01
What would you like to do?
February 6, 2020 - Apropos

Show date: February 6, 2020


Multi-stage builds in Docker

Markdown Editor Single Page Application

50% off during launch:

REPL Exercise

Parse query parameters

URLs can have optional query parameters. They are the key-value pairs that follow the path.

Write a function that takes a URL (represented as a string) and parses out the query parameters into a hashmap.


  • The query string is the string containing the query parameters. It appears after the ? and before a #. Ex:
  • The keys and values are URL Encoded. You can use to decode them.
  • The key-value pairs are separated by &. Ex: a=1&b=2
  • Each key-value pair contains the key, followed by =, followed by the value. Ex: a=1


Query parameters can contain duplicate keys. Handle them gracefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment