Module 6 · Interview Prep: A Stock Exchange Matching Engine Lesson 38 of 54
Invariants for an Exchange
Price then time, no order lost, the same trades on replay, and every order answered.
Transcript
28 sentences · select one to jump thereCheck your understanding
Two sell orders wait at $184.25: A arrived first, B a moment later. A buy arrives that can take only one of them. Which trades?
Lesson notes
The rule
Write every input down before acting on it: a crash must never lose an accepted order