URL Query String Parser
Parse a URL query string into a key-value map, where values can be a boolean (for keys with no value), a string, or a list of strings (for repeated keys). Return a list of key-object pairs representing the parsed query parameters.
Asked at:
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Late July, 2026
Senior
Early June, 2026
Mid-level
Late April, 2026
Senior
Parse URL query string into key-value map. Rules: ?a=b&c=d → {""a"": ""b"", ""c"": ""d""} ?sd → {""sd"": "True"} (key only, no value) ?a=b&a=c&a=d → {""a"": [""b"", ""c"", ""d""]} (repeated keys) Output needs to be returned. Can assume input will be valid. Return list of key and values. Value can either be string or list of string. It's possible that value can be boolean as well as string. For this, we can return list of key and object.
Hello Interview Premium
Your account is free and you can post anonymously if you choose.