Round 1
Implement a simplified JSON parser.
-
The parser should handle:
- Primitive types (String, Number, Boolean, null)
- JSON objects (e.g., {"key":"value"} )
- JSON arrays (e.g., ["1", "two", "false"])
-
Handle nested JSON objects and arrays.
-
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)


