Quant Interview Practice Questions
题目详情
In quantitative trading, pair trading strategies require simultaneous execution of orders across multiple assets. When execution engines process fill callbacks concurrently, portfolio positions must be updated atomically to maintain an accurate risk profile and prevent race conditions. Utilizing scoped locks ensures thread-safe updates across overlapping asset pairs while avoiding deadlocks caused by arbitrary lock acquisition orders. Task Implement the Portfolio class to manage positions for 1