TradingHub interview question

Graph-based problem, as far as I can recall.