Calculating expected profit across multiple trading instruments
This coding problem tests your ability to translate a market-making scenario into a clean expected-value calculation. You are given fill probabilities for bid and ask orders on multiple instruments, along with the profit per fill, and must compute the total expected profit across the trading session.
The core challenge is understanding how to combine probabilities and payoffs correctly. Each instrument's bid and ask are filled independently; you need to determine which fill outcomes contribute to profit and weight them by their joint probability. The solution requires careful handling of floating-point arithmetic to meet a tight tolerance threshold (within 10-6). Interviewers at market-making firms use this type of problem to verify that you can move fluently between financial intuition and precise code, and that you respect numerical accuracy in production systems.
- Independence of fill events across and within instruments
- Expected value as a sum of weighted outcomes
- Floating-point precision and tolerance in numerical comparisons