Parsing a Message Stream
Parsing shows up in these assessments far more than a computer science syllabus would predict, and for an obvious reason: every trading system starts with bytes arriving from somewhere else, in a format you did not choose and cannot change. Several major firms set parsing problems, and they are all really about the same three questions.
Where does one message end?
A stream is a sequence of bytes, not a sequence of messages. Recovering the boundaries is called framing, and there are three schemes.
Delimited is easiest to write, length-prefixed is what real protocols use.
The rest of this lesson is for subscribers
Unlock every lesson in Programming for Quantitative Developers, and every other premium course.
Subscribe to continueTest your knowledge
Keep reading Programming for Quantitative Developers
25 lessons in this course, and every other premium course, on one subscription.
- Every lesson in every course, with the worked examples and interactive simulators
- Graded questions on every lesson, with explanations for the wrong answers as well as the right one
- The trainers, timed assessments and brainteaser library that go with them