Microsoft | SDE 2 | 3 YoE

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2025-03-22Added By Anonymous
Source: Link

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:

1Input: {"name": "John", "age": 30, "isStudent": false} 2Output: {name=John, age=30, isStudent=false} 3 4Input: {"user": {"id": 1, "name": "Alice"}, "active": true} 5Output: {user={id=1, name=Alice}, active=true} 6 7Input: { "file_ids" : [1, 2 ,3] } 8Output: {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