Parsing
Python Parsing Interview Questions
Parsing here means getting structured data back out of a model’s reply. A model asked for JSON returns it wrapped in a sentence or a code fence often enough that the calling code has to find the object, parse it, and then check that it holds what it claims to hold.
What parsing questions ask you to do
Across the questions here, these are the shapes that come up:
- Find and parse the first complete JSON object in a reply
- Ignore braces that appear inside quoted strings
- Report which fields are missing or hold the wrong type
- Return something sensible when there is nothing to parse
- Pull a tool call and its arguments out of a response
Common mistakes with parsing
Taking everything between the first opening brace and the last closing one, which swallows a second object and any prose between them. Counting the braces properly means tracking whether you are inside a quoted string. On the checking side, a boolean passes a naive number test in Python, because True is an integer as far as isinstance is concerned.
Questions to practice
Roles this comes up in
Companies these come from
Other topics
- Filtering7
- Logical operators4
- Calculations11
- Conditional logic12
- NULL handling9
- Dates16
- Joins15
- Aggregations14
- Subqueries5
- Window functions32
- Reshaping15
- Arrays6
- Strings11
- Hashing8
- Two pointers4
- Sliding window1
- Binary search4
- Sorting1
- Math3
- Lists5
- Tuples3
- Dictionaries3
- Ranking16
- Running totals10
- Deduplication2
- Chunking1
- Similarity1
- Token budget2
- Backoff3
- Agent loop1
- Cost1