Prepping for the 2027 recruiting cycle? Use code 2027RC for 10% off, valid until July 31st! Oh, and check out our members-only recruitment services.

Logo

Coding preview

An old JSON parsing mission

What this preview is

About this preview

An old JSON parsing mission is a medium quant coding problem on language knowledge in Cpp.

Unlock full access to getcracked

Join to unlock this problem, detailed solutions, and our complete library of quant finance interview prep.

What this C++ JSON parsing problem tests

This is a medium-difficulty coding problem that asks you to implement a recursive descent parser for a lightweight JSON subset. It appears frequently in technical interviews at trading firms and finance technology companies because it combines string handling, memory management, and recursive algorithm design in a compact, realistic scope.

The problem rewards clean separation of concerns: tokenizing input, recursively parsing structure, and reconstructing canonical output. You will need to handle both leaf values (strings) and composite structures (arrays) using a variant type, manage string_view correctly to avoid copies, and ensure your parser gracefully skips whitespace while respecting JSON syntax rules. Interviewers often probe your approach to error handling, your reasoning about memory lifetime, and whether you can trace through nested parse calls.

  • Recursive descent parsing and grammar rules
  • String parsing and escape-free lexing
  • std::variant and discriminated unions
  • Round-trip serialization (parse-to-string consistency)
  • Pointer validity under string_view semantics