Reconstructing strategy groups from deployment logs using union-find
This hard coding problem tests your ability to model a real-world quantitative infrastructure challenge: grouping deployment events that belong to the same trading strategy based on shared market-data subscriptions. It requires both graph connectivity reasoning and careful handling of consistency constraints.
The core task is to build and query connected components where entries are linked by identical (Symbol, VenueToken) pairs, then filter results by timestamp range and detect invalid (ambiguous) inputs where a symbol or venue token maps inconsistently within a connected group. Strong solutions use union-find to track component membership efficiently, validate the mapping consistency of symbols and tokens across the group, and sort results correctly by timestamp and deployment ID.
- Union-find (disjoint-set union) for transitive closure and component queries
- Bidirectional mapping validation within connected components
- Range filtering and multi-key sorting
- Ambiguity detection: one-to-many symbol or token relationships