Questions / Quant development, Streaming market data
A duplicate trade arrives
Active volume is 500 shares and already includes event E7 of 40 shares. E7 is replayed twice more. Under exactly-once aggregation, what is the volume?
Answer it in the app It's free. You get hints, a second try if you miss, and a follow-up question.
Show the answer and worked solution
Answer: 500 shares
- E7 is already counted once.
- Both replays carry the same immutable ID, so they add nothing.
- Volume stays at 500.
Interview shortcut. Replays of a counted ID add nothing.
Takeaway. Same event ID: count it once.
In the app this has a follow-up where one thing about the setup changes. Try the follow-up.