Trade Processor With Subscribe and Unsubscribe

Asked at Bloomberg · System Design for ML · Difficulty: Medium

A trading system receives a stream of trades. Other parts of the system want to hear about only some of them, for example every trade in one symbol. Build a `TradeProcessor` that accepts new trades, lets clients subscribe a callback with a filter, returns a handle for each subscription, and lets clients cancel a subscription by its handle.

Loading the problem…