7 problems
Coding interview questions
Algorithms and numerical work with a trading flavour. Correctness first, then complexity, then the practical detail that shows you have written production code.
Maximum drawdown in one pass
Warm-upGiven an array of prices in time order, compute the maximum drawdown in a single pass.
Rolling median of a stream
HardMaintain the median of the last k values of a stream efficiently.
Design a limit order book
HardWhat data structures would you use for a limit order book that must add, cancel and match quickly?
Sample from a stream of unknown length
StandardPick one element uniformly at random from a stream whose length you do not know in advance, using constant memory.
Why the loop order matters
StandardTwo implementations of matrix multiplication have identical complexity but one runs several times faster. Why?
Price an option by simulation
StandardHow would you price a European call by Monte Carlo, and how do you make the error small enough to be useful?
The bug that only shows up in production
Warm-upWhy should you not sum prices as floating point, and what do you do instead?