Pinterest·Software Engineer·Technical Phone Screen
- You have a class with a next() method that returns chunks of a string one at a time. The chunks may contain a two-character newline delimiter that can be split across consecutive chunks. Write a function that reads until the stream is exhausted and reconstructs the original lines correctly.
“The split-delimiter case is what got me at first.”