Validate order book data across multiple databases
Jane StreetSoftware Engineer · OnsiteLast updated
This question evaluates a candidate's competency in designing data-validation and reconciliation systems for financial order books, including defining invariants, ensuring cross-database consistency, and handling edge cases like partial fills, cancels, out-of-order events, duplicates, and replayed messages.
Assume your organization stores order book–related data in multiple databases (e.g., one for raw exchange messages, one for normalized orders, one for trades/executions, one for analytics).
You suspect data quality issues and want to validate that all stored data follows order-book logic.
Design a validation approach that answers:
- What invariants must always hold for orders, executions, and the resulting order book?
- How do you validate within one database (table-level constraints, batch checks)?
- How do you validate across databases (reconciliation) when they may be eventually consistent?
- How do you handle edge cases: partial fills, cancels, replaces, out-of-order events, duplicates, and reconnect replays?
Be explicit about what you would compute and compare, and how you’d operationalize it (alerts, dashboards, backfills).
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.