Quant interview preparation
Prop market making and quantitative research, weighted the way the interviews actually are: probability and expected value, statistics and machine learning, market making logic, programming and options. Every question is either traced to a named firm from a public candidate report, or tagged at desk level when we could not trace it, and every probability answer shows the reasoning path rather than just the number.
100 questions, mapped to the firms that asked them
- Questions
- 100
- Traced to a firm
- 53
- Firms
- 15
- Updated
- September 2026
076You have K sorted arrays on disk, too large to load at once. How do you merge them into one sorted output?CitadelEquity Capital Markets · New York · 2026
Say this
K-way merge with a min heap of size K. Push the first element of each array into the heap, repeatedly pop the minimum and write it out, then push the next element from whichever array the minimum came from. Time is N log K, memory is O(K) plus your buffers.
Then walk it
- The heap holds one candidate per array, each entry tagged with which array it came from and the index within it. Pop the smallest, emit it, and refill from that same array.
- Complexity: N total elements, each pushed and popped once, each operation log K. So N log K, which beats concatenate-and-sort at N log N whenever K is much smaller than N.
- The disk part is the real content of the question. You do not read element by element, you read blocks. Keep a buffer per array, say a few megabytes each, refill it when it drains, and write the output through a large buffer too. The heap operations are free compared with I/O, so the design goal is sequential reads and few of them.
- If K is very large, K times the buffer size exceeds memory, and then you merge in passes: merge groups of, say, 100 files at a time, then merge the results. That is exactly how external merge sort works, and total I/O is N times the number of passes.
- Practical notes I would raise: use a tournament tree or a loser tree instead of a binary heap if you want fewer comparisons per element, handle the tie-breaking rule explicitly if stability matters, and if this is a real system, check whether the operating system's readahead is already doing your buffering for you before you build it yourself.
Where candidates lose it
Answering merge them pairwise, which is K times N in the worst case, or ignoring the on-disk part entirely. The interviewer put the data on disk deliberately, so talk about block-sized buffered reads and what happens when K is too large to buffer. State the N log K complexity explicitly.
Expect next
- What if K is a million?
- How large would you make the buffers, and why?
- How would you parallelise it?
Reported by candidates at Citadel (Equity Capital Markets, New York, 2026). Source: Wall Street Oasis.
077Given an array and a window of size k, return the maximum in each window as it slides.Akuna CapitalQuant Development · Chicago · 2025
Say this
Monotonic deque, O(n) total. Keep a deque of indices whose values are strictly decreasing. Before pushing a new index, pop from the back everything smaller than the new value, and pop from the front anything that has fallen out of the window. The front is always the maximum.
Then walk it
- Why the deque is monotonic: if a new element is larger than something behind it, that older smaller element can never be the maximum of any future window, because the new one is both larger and more recent. So it is safe to discard permanently.
- Each index is pushed once and popped once, so the total work is O(n) even though a single step can pop many elements. That amortised argument is the thing to say out loud, because it is what distinguishes this from the naive O(n k).
- Store indices, not values, so you can test whether the front has expired by comparing front index against i minus k plus 1.
- Alternatives and why they are worse: a max heap gives O(n log k) and needs lazy deletion of expired entries. A balanced BST or a multiset gives O(n log k) too. Both are fine and both are beaten by the deque.
- Where this actually matters on a trading system, which is worth mentioning: rolling extremes over a tick window, running high and low for a breakout signal, and rolling maximum drawdown. The same structure with the comparison reversed gives you the rolling minimum, and the O(1) amortised cost per tick is what makes it usable in a hot path.
Where candidates lose it
Reaching for a heap and stopping there. The heap answer is acceptable but it is not the answer to this question, and the interviewer is specifically looking for the monotonic deque and the amortised O(n) argument. Also remember to expire the front by index, which is the bug that shows up most often in live coding.
Expect next
- Prove the amortised complexity.
- Now give me the rolling median instead.
- How would you handle a window defined by time rather than by count?
Reported by candidates at Akuna Capital (Quant Development, Chicago, 2025). Source: Wall Street Oasis.
079How would you store key-value pairs, and what are the tradeoffs between the implementations?Jump TradingEngineering · Cambridge · 2019
Say this
Hash table for O(1) average lookup with no ordering, balanced tree for O(log n) with ordered iteration and range queries, and a flat sorted array if the data is static and you care about cache behaviour. The choice is driven by whether you need ordering and what your access pattern looks like in memory.
Then walk it
- Hash table: O(1) average, O(n) worst case on collisions, no ordering, and rehashing causes an occasional large latency spike. That spike is a real problem on a trading hot path and it is why people pre-size their maps.
- Balanced tree, red-black or B-tree: O(log n) guaranteed, ordered traversal, range queries, and predictable latency. Worse constants and worse cache locality because of pointer chasing.
- The tradeoff that matters most in practice is memory layout, not big-O. C++ unordered_map uses separate chaining with nodes scattered across the heap, so every lookup is potentially a cache miss. An open-addressing flat hash map keeps everything in one array and is commonly two to three times faster in real workloads at the same asymptotic complexity.
- For a mostly-static table, a sorted array with binary search beats both: contiguous memory, no pointers, and for small n a linear scan beats binary search because it is branch-predictable and prefetchable. Under about 16 to 32 entries, linear wins.
- And on disk the answer changes completely: B-trees for read-heavy workloads because of the branching factor against block size, LSM trees for write-heavy because they turn random writes into sequential ones. I would want to know the read-write ratio and whether the working set fits in cache before choosing anything.
Where candidates lose it
Answering hash map, O(1), done. The question says tradeoffs, so it is a systems question and the interviewer at a trading firm cares about tail latency and cache behaviour more than asymptotic complexity. Mention rehashing spikes and pointer chasing, and ask what the access pattern is.
Expect next
- Why is std::unordered_map often slow in practice?
- How would you avoid latency spikes from rehashing?
- What changes if the data lives on disk?
Reported by candidates at Jump Trading (Engineering, Cambridge, 2019). Source: Wall Street Oasis.
083Write an algorithm to find all the primes from one to n, and then optimise it.AQR Capital ManagementResearch · Greenwich · 2015
Say this
Sieve of Eratosthenes. Mark every multiple of each prime as composite, and the unmarked survivors are the primes. Time is n log log n, which is essentially linear, and memory is n bits.
Then walk it
- The baseline to reject first: trial division on each number up to its square root is about n times root n over log n, far worse. Say why the sieve wins before you write it.
- The sieve itself: start at p equal to 2, mark 4, 6, 8 and so on, then advance to the next unmarked number. Two optimisations that come free: start marking at p squared rather than 2p, because smaller multiples are already marked, and stop the outer loop at root n.
- Memory optimisations: store only odd numbers, halving memory, use a bit array rather than bytes for an eightfold saving, and if n is large, sieve in cache-sized blocks. That last one matters more than anything else in practice, because a naive sieve over 10 to the 9 is dominated by cache misses, and segmenting it can be several times faster at identical complexity.
- Further refinements if pushed: a wheel sieve skipping multiples of 2, 3 and 5 removes about 77 percent of the candidates, and the sieve of Atkin is asymptotically better at n over log log n but is slower in practice and much harder to get right.
- And the answer to a different question they may be asking: if you want to test whether one large number is prime rather than enumerate a range, the sieve is the wrong tool entirely and you want Miller-Rabin, which is probabilistic and fast. Recognising that enumerate and test are different problems is worth saying.
Where candidates lose it
Giving trial division and calling it done, or giving the sieve with no optimisation when the question explicitly asks for one. The optimisations they want in order are: start at p squared, skip evens, use a bit array, then segment for cache. Naming cache blocking is what marks you out, because it is the one that matters at scale and it is not in the textbook answer.
Expect next
- What is the memory cost for n equal to a billion, and how would you reduce it?
- How would you parallelise the sieve?
- Now test whether one very large number is prime.
Reported by candidates at AQR Capital Management (Research, Greenwich, 2015). Source: Wall Street Oasis.
Firm tags come from public, anonymous candidate reports on Wall Street Oasis: strong signal, not sworn testimony. Firms are named as the places a question was reported, not as partners of Fin Maverick. Answers are written for this page to show how to think out loud; they are not scripts to recite.

