Designing an event-driven order pipeline in Python
This hard coding problem tests your ability to build a real-world order-processing system using design patterns common in quantitative trading platforms. You'll need to implement a multi-stage pipeline where each stage validates, checks risk constraints, or executes an order—and communicate between stages via a decoupled event bus.
The problem rewards strong separation of concerns: an abstract base class for stages, a pub/sub event bus with priority and wildcard support, a chain-of-responsibility orchestrator, and careful error handling at each step. You'll need to think about state transitions, how to emit events without tight coupling, and how to gracefully stop the pipeline on failure while preserving order metadata for audit trails.
- Chain of responsibility and stage-based processing
- Pub/sub event buses with priority ordering and wildcard subscriptions
- Custom exceptions and error propagation
- Runtime stage registration and composition
- Timestamp and status tracking for order lifecycle