JSON WTF
A totally normal and not hard quiz about JSON
What you're getting yourself into
You will have three options for each JSON snippet
- valid: parsers should accept the input according to RFC 8259
- invalid: parsers should reject the input according to RFC 8259
- maybe valid: up to the parser to decide whether to accept the input or otherwise ambiguous
The questions aren't meant to trick you. There won't be any gotcha whitespace or unannounced unprintable characters. If a string says "pretend I'm encoded in UTF-8", then trust it. There's enough weirdness to go around as is!
Shout outs
Shout out to Nicolas Seriot for their great article Parsing JSON is a Minefield. I learned most of these fun facts from their conformance test suite and article while writing my own JSON parser, JJPWRGEM! Give their article a read for a more technical dive into what this quiz provides
Shout out to samwho for inspiration. Check out e-mail.wtf and jsdate.wtf if you liked this quiz!
Play testing scores
Note: I removed some less engaging questions like unicode escapes post playtest
- Average score: 15.5/40
- Median score: 15/40
- Highest score: 27/40
- Lowest score: 14/40
All who tested were at least tangentially familiar with JSON. Ironically web developers tend to score lower since they are biased towards JavaScript's rules. The higher scores came from those who Googled and read the RFC as they went
I thought everyone would get like 35 right, but apparently building a JSON parser will color your experience. Relevant XKCD