New
ML System Design & SQL tracks just landed
See what's new
×
Question Bank
Pricing
Blog
Forum
HOT
JobRadar
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
Microsoft
Coding Question
AI Insights
Quick Summary
Parse a list of text chunks to extract content preceding a specific stop token while preserving chunk boundaries.
Truncate the chunk containing the stop token to retain only the text before it, discarding the token and following content.
Handle edge cases including missing tokens, empty chunks, and tokens appearing at the start of a chunk.
What This Tests
String search and substring extraction operations.
Linear iteration with early termination conditions.
Managing state and control flow during data streaming simulation.
Handling boundary conditions and partial match results.
Common Patterns
Two Pointers
Collapse
Hint 1
Hint 2
Hint 3
What Interviewers May Ask Next
Accepted
65
/132
Acceptance Rate
49.2%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.6-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
stream =
Output
Expected