Market Data Feed Parser

Medium-Hard ● Live C++ Rust Java Python

The Problem

Parse 500,000 market data messages across 8 symbols from multiple exchanges. Maintain real-time order books for each symbol, output top-of-book snapshots, and compute VWAP and spread statistics.

Handle different message types: add orders, remove orders, fills, and trades. Ensure accurate order book state and efficient data processing.

Evaluation Criteria

Correctness (60%)

Order book state must be accurate for all symbols. Top-of-book snapshots correct. VWAP and spread calculations accurate to 4 decimal places.

Performance (40%)

Wall-clock time on 500K market data messages. Memory usage for maintaining 8 order books.

Input Format

First line
N S where N = number of messages, S = number of distinct symbols.
Each message line
comma-separated, first field is the type tag:

Output Format & Sample

Sample input (first 8 lines, full file linked below):

50 5
A,1000042005,1001,B,9986,892
A,1000047802,1002,B,9987,179
A,1000094827,1003,B,9972,206
A,1000140680,1004,B,9952,22
M,1000163321,1004,35
M,1000168585,1003,138
A,1000171688,1005,B,9986,147
... (more)

Expected output for that sample (first 8 lines):

1000163321,9987,179,0,0
1000247346,9987,179,10026,4740
1000379513,9987,179,10026,4740
1000553814,9991,752,10002,8
1000720991,9991,752,10002,8
1000770422,9991,752,10002,8
1000896737,9991,752,10002,8
1001089220,9992,79,10002,8
... (more)

↓ download full sample input  |  ↓ download expected output

Test your solution locally: ./your_solution < input.txt | diff - output.txt

Common Pitfalls

Performance Tier Thresholds (applied by the grader)

LanguageGoldSilverBronzeTier 4
C++<400ms<1500ms<8000mselse PASS
Rust<400ms<1500ms<8000mselse PASS
Java<800ms<3000ms<15000mselse PASS
Python<3000ms<10000ms<50000mselse PASS

Submission Rules

Challenge Stats

Messages: 500,000
Symbols: 8
Order book depth: unlimited
Gold Target: <1s

Starter Templates

↓ skeleton.cpp ↓ skeleton.rs ↓ Skeleton.java ↓ skeleton.py

Submit Your Solution

You can submit multiple times. Best result per language counts.

Resources

Leaderboard →