Cursor·Software Engineer·Technical Phone Screen
- Build a streaming Markdown parser that handles inline code spans (single backtick) and fenced code blocks (triple backtick), where input arrives in arbitrary chunk sizes and delimiters can be split across chunk boundaries.
- Should unterminated code spans at the end of the stream be emitted as plain text or held in a buffer indefinitely?
- How would you extend the parser to support tilde characters as an alternate fence marker?
- How would you prevent the parser from buffering an unbounded amount of text while waiting for a closing delimiter?
- How would you make the parser resumable if the process restarts mid-stream?
“This one hurt a little.”