Microsoft | SDE 2 | 3 YoE

Anonymous User
1114
Mar 22, 2025

Round 1

Implement a simplified JSON parser.

  1. The parser should handle:

    • Primitive types (String, Number, Boolean, null)
    • JSON objects (e.g., {"key":"value"} )
    • JSON arrays (e.g., ["1", "two", "false"])
  2. Handle nested JSON objects and arrays.

  3. Throw an exception (IllegalArgumentException) if the input is not valid JSON.

Examples:

Input: {"name": "John", "age": 30, "isStudent": false}
Output: {name=John, age=30, isStudent=false}

Input: {"user": {"id": 1, "name": "Alice"}, "active": true}
Output: {user={id=1, name=Alice}, active=true}

Input: { "file_ids" : [1, 2 ,3] }
Output: {file_ids=[1, 2, 3]}

Round 2

Implement an 'auto-complete' engine for a text editor/IDE.
Create low level design components, interfaces and contracts.

Comments (4)