Trading Profit With One, Many or k Trades
Asked at Citadel · Coding Questions · Difficulty: Hard · Last asked May 7, 2026
You know in advance the price of one stock on each of `n` consecutive days. A trade means buying one share on some day and selling it on a later day; the profit of the trade is the sell price minus the buy price. Compute the largest total profit you can make under three different limits on the number of trades. The three parts build on each other, and the last one contains the first two as special cases.
Loading the problem…
More Citadel interview questions
- LLM Fundamentals: Quantization, FlashAttention, Parallelism
- LLM Questions: Training Systems, Hardware, and Scaling
- OLS Regression Between Independent Gaussian Random Vectors
- EQR Alpha-Factor Research Deep-Dive + LLM Inference Stability
- HFT Onsite Round 3 — Sort Complexity + Linux Fundamentals + tail(n) Design
- Weighted Random Sampling with Insert - Delete