Fixed Price Purchase Optimizer
Optiver interview questions · Hard · OA round · 7 tests
You must buy n identical items, one item per day. On each day, the market price is
drawn independently and uniformly from the interval [lo, hi].
After seeing that day's market price x, you must immediately buy the item using
exactly one of these two options:
- pay the market price
x, or - use a pre-negotiated fixed fallback price
fixedPrice.
Run your code with Ctrl+Enter to see results.