pagesxyz
JobsCompaniesBlogResourcesPost a JobCommunity
FeedbackContact
JobsCompaniesResourcesBlogContactFeedback
←

Patterns in Quantitative Finance Interviews

2026-05-19

Why Sequence Problems Dominate Quant Interviews

Sequence problems show up in almost every quant finance interview — from the algorithmic rounds at Jane Street and Hudson River Trading to the probability brainteasers at Citadel, Optiver, and SIG. The reason is structural: trading is fundamentally about reasoning over ordered data. Prices arrive as time series, orders arrive as queues, fills arrive as streams. If you can think clearly about a sequence of values, you can think clearly about a market.

Most candidates fail sequence questions not because the math is hard, but because they don't recognize which pattern they're looking at. Below are the dozen-or-so sequence patterns that come up most often, with what triggers each pattern and the canonical question to practice. Master these and you'll have a reliable mental decomposition for almost any sequence question you encounter.

Algorithmic Sequence Patterns

1. Two pointers

When to reach for it: the array is sorted (or can be sorted cheaply), and you're looking for a pair or a partition. Also: shrinking a window from both ends.

Classic question: given an array of stock prices and a target spread, find two days whose price difference equals the target. The naive O(n²) two-loop solution gets a polite "can you do better?" — the two-pointer solution scans in O(n).

Tell-tale signal: the problem mentions "pair", "two of", or "complement equals X".

2. Sliding window

When to reach for it: you need an aggregate (max, min, sum, count of distinct) over every contiguous window of length k. Or, the window length is variable but bounded by a constraint that monotonically tightens.

Classic question: rolling N-day volatility, or "longest substring of prices below the moving average". You maintain a deque or running sum and slide one element at a time, paying O(1) per step instead of recomputing from scratch.

Tell-tale signal: "every window of size k", "longest contiguous", "shortest subarray such that".

3. Prefix sums and cumulative metrics

When to reach for it: you need a sum or count over arbitrary contiguous ranges, repeatedly. Quant-flavored version: cumulative PnL, drawdown, exposure-at-time-t.

Classic question: given an array of daily PnL, find the worst N-day stretch. Prefix-sum it once, then any range sum becomes a single subtraction. O(n) precompute, O(1) per query.

Tell-tale signal: "many range queries", "subarray sum equals K", "cumulative PnL". Combines naturally with hash maps for "subarray sum equals K" — a Citadel favorite.

4. Kadane's algorithm (max subarray sum)

When to reach for it: find the contiguous subarray with maximum sum. Trading framing: given daily returns, find the best holding period in hindsight.

Classic question: max profit on a single buy-sell. Trivial if you transform it into max subarray over daily price-deltas.

Why interviewers love it: the O(n) DP solution is short enough to derive on a whiteboard but the bug surface (handling all-negative, single-element edge cases) is wide enough to separate candidates.

5. Monotonic stack / monotonic deque

When to reach for it: "for each element, find the next greater / next smaller". Or: streaming max/min over a sliding window in amortized O(1).

Classic question: daily stock prices, return for each day the number of days you would have to wait until a higher price. Brute O(n²) is rejected — the monotonic stack pops in O(n) total.

HFT angle: when interviewing for low-latency roles, this pattern shows up as "implement a streaming high-water-mark" or "rolling top-of-book". Same data structure, dressed up.

6. Sequence dynamic programming

When to reach for it: "longest", "smallest cost", "number of ways" — and each step depends on a small fixed number of prior steps.

Classic questions: longest increasing subsequence (LIS — for "longest streak of rising prices"), edit distance (used in some trade-matching questions), coin change ("how many ways to make a dollar"). Quant interviews love LIS variants because the O(n log n) patience-sort solution is non-obvious and rewards careful thinking.

Tell-tale signal: a result that depends recursively on a small slice of previous results.

7. Binary search on a sequence

When to reach for it: the array is sorted, OR there's a monotonic predicate you can test in O(n) — and you want to find the threshold.

Classic question: "minimum capacity required to ship packages in D days". The capacity is monotonic in feasibility, so binary search over capacities and check feasibility in O(n) — total O(n log W).

Quant variant: "find the implied volatility that prices this option at X". Newton's method works, but bisection on a sorted predicate is bulletproof.

8. Reservoir sampling

When to reach for it: "stream of unknown length, pick K uniformly at random". Comes up at HFT-adjacent firms (Two Sigma, Jane Street).

Classic question: sample one fill uniformly at random from a stream of fills, in O(1) space. The proof — each element survives with probability 1/n at step n — is itself a probability-style question.

Probability / Math Sequence Patterns

9. Run-length probability (consecutive successes)

The setup: a coin or a die is repeated; you care about the first occurrence of a specific run.

Classic question: "flip a fair coin until you get two heads in a row — what's the expected number of flips?" Set up states by current run length and write a linear recurrence: E = 1 + ½·E₁ + ½·E; E₁ = 1 + ½·0 + ½·E. Solve: E = 6. Generalizes to "N heads in a row" — answer is 2^(N+1) − 2 for a fair coin.

Tell-tale signal: "until N in a row", "until pattern XYZ appears", "expected time to ruin".

10. Random walks and gambler's ruin

The setup: position evolves +1 / −1 each step with given probabilities; you ask absorption-time or hit-probability questions.

Classic question: "you start with $50, bet $1 on a fair coin each round; what's the probability you reach $100 before $0?" By the symmetric random walk result, probability = starting/target = 50/100 = ½. Biased version (p ≠ ½) yields the geometric ruin formula.

Variants: drunkard's walk on a line, hitting time to a wall, expected number of returns to origin. Optiver and IMC love these.

11. Markov chains and stationary distribution

When to reach for it: the state evolves probabilistically, future depends only on current state, you want long-run averages or first-passage times.

Classic question: "a frog hops between 3 lily pads with transition matrix P. What fraction of time, in the long run, does it spend on pad 2?" Solve πP = π, π·1 = 1.

Quant angle: showing up in mid-frequency strategy interviews as "regime-switching" questions, where market state evolves through bull/bear/range with given transition probabilities.

12. Stopping times and optional sampling

When to reach for it: "play until condition X is met — what's the expected payoff?"

Classic question: "I flip a fair coin until I see HTH. Expected number of flips?" Trickier than the run-length version because patterns can overlap. Use Conway's leading-number algorithm or set up overlapping states. The "HTH" answer is 10; the "HHH" answer is 14 — they're different because HHH "resets harder" on failure.

Why it matters: the "compare HTH vs HHH" question separates candidates who memorize from candidates who reason. Always reason.

13. Recurrence and linearity of expectation

When to reach for it: you can write the expected value as a function of itself with a smaller subproblem.

Classic question: "n people throw their hats in a pile, then each grabs one randomly. Expected number who get their own hat?" Use linearity of expectation: each person has 1/n probability of getting their own hat, so the answer is n·(1/n) = 1, regardless of n. This is a quant-interview favorite because it's deceptive — most candidates start trying to enumerate fixed-point permutations and get lost.

14. Order statistics of i.i.d. sequences

When to reach for it: "n samples drawn from the same distribution — what's the expected value of the max / min / k-th order statistic?"

Classic question: "n people enter a uniform raffle on [0, 1]. What's the expected value of the maximum?" The k-th order statistic of n uniforms on [0,1] has expectation k/(n+1), so the maximum is n/(n+1).

Trading angle: the same machinery answers "expected best fill from n quotes" — natural in market-making interviews.

Number Sequence Pattern Recognition

Beyond algorithms and probability, quant interviews — especially at the mental-math-heavy shops like Optiver, SIG, IMC, and Jane Street's first round — like to drop in raw "what's the next number" puzzles. The good news is that 90% of them collapse into one of five families. Here's how to recognize each in under 10 seconds.

15. Arithmetic sequences

Pattern: constant first difference. e.g., 3, 7, 11, 15, 19 → next is 23 (common difference 4).

Recognition cue: subtract adjacent terms. If they're all equal, you're done.

General form: aₙ = a₁ + (n−1)·d. Sum of the first n terms is n·(a₁ + aₙ)/2.

16. Geometric sequences

Pattern: constant ratio. e.g., 2, 6, 18, 54, 162 → next is 486 (ratio 3).

Recognition cue: divide adjacent terms. Constant ratio = geometric.

General form: aₙ = a₁·r^(n−1). Sum of the first n terms is a₁·(rⁿ−1)/(r−1). The infinite sum converges to a₁/(1−r) when |r| < 1 — useful for the geometric expectations that come up in stopping-time problems.

17. Quadratic and higher-order polynomial sequences

Pattern: first differences are not constant but second differences are. e.g., 2, 5, 10, 17, 26 → first differences 3, 5, 7, 9 → second differences 2, 2, 2 → so this is aₙ = n² + 1. Next term is 37.

The killer trick — the finite-difference method: compute differences of differences. If the k-th differences become constant, the underlying sequence is a polynomial of degree k. Quadratic (degree 2) shows up most often — its second differences are constant.

Worked example: 1, 4, 9, 16, 25 — first differences 3, 5, 7, 9 — second differences 2, 2, 2 → degree-2 polynomial, in fact n². Even when the polynomial isn't a clean nⁿ, the method works: fit aₙ = An² + Bn + C using any three terms, and you have your formula in 30 seconds.

Recognition cue: first differences are linear-looking (not constant, but increasing/decreasing steadily).

18. Linear recurrences (Fibonacci family)

Pattern: each term is a fixed linear combination of the previous k terms. e.g., 1, 1, 2, 3, 5, 8, 13 — each term = sum of previous two (Fibonacci, aₙ = aₙ₋₁ + aₙ₋₂). Or 2, 1, 3, 4, 7, 11, 18 — Lucas numbers, same recurrence different seeds.

Recognition cue: try the simplest guesses first — is aₙ = aₙ₋₁ + aₙ₋₂? Is aₙ = 2·aₙ₋₁ − aₙ₋₂? Is aₙ = aₙ₋₁ + n? Test on the first few terms.

Why this matters: linear-recurrence sequences have closed-form solutions via characteristic roots. The famous Binet formula gives the n-th Fibonacci number directly: Fₙ = (φⁿ − ψⁿ)/√5 where φ = (1+√5)/2 is the golden ratio. Knowing this is signature quant-interviewer bait at SIG and Jane Street.

19. Multiplicative and exponential recurrences

Pattern: aₙ depends multiplicatively on previous terms, not additively. e.g., 2, 4, 16, 256, 65536 → each term is the previous squared. Or 1, 2, 6, 24, 120 → factorials (aₙ = n·aₙ₋₁).

Recognition cue: the growth is super-linear. If the ratios aₙ/aₙ₋₁ are themselves growing, you're in multiplicative or factorial territory rather than geometric.

Tip: always check for factorials when you see fast growth that doesn't fit a clean geometric ratio. Catalan numbers (1, 1, 2, 5, 14, 42, …) also live here — they grow like 4ⁿ/n^(3/2) and show up in random-walk and ballot-problem questions.

20. Known-sequence pattern matching

Some sequences come up so often that recognition is the whole game. Memorize the first 5–6 terms of:

  • Powers of 2: 1, 2, 4, 8, 16, 32, 64, 128 — and the Mersenne primes 3, 7, 31, 127.
  • Powers of 3: 1, 3, 9, 27, 81, 243.
  • Factorials: 1, 2, 6, 24, 120, 720, 5040.
  • Perfect squares: 1, 4, 9, 16, 25, 36, 49, 64.
  • Perfect cubes: 1, 8, 27, 64, 125, 216.
  • Triangular numbers: 1, 3, 6, 10, 15, 21 — sum of first n integers, n(n+1)/2.
  • Catalan numbers: 1, 1, 2, 5, 14, 42, 132.
  • Primes: 2, 3, 5, 7, 11, 13, 17, 19, 23. (Less common but interviewers love to throw it in as a "trick" disguised as a pattern.)
  • Fibonacci: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55.

If the sequence doesn't match arithmetic / geometric / polynomial / linear-recurrence, your next move is to check whether you're staring at one of the above in disguise (offset by a constant, or interleaved with another sequence).

The 10-second decision tree

When the sequence appears, run through this in order:

  1. Are adjacent differences constant? → arithmetic. Done.
  2. Are adjacent ratios constant? → geometric. Done.
  3. Compute second / third differences. If constant at level k → polynomial of degree k. Fit coefficients.
  4. Try linear recurrences: aₙ = aₙ₋₁ + aₙ₋₂, aₙ = 2·aₙ₋₁ − aₙ₋₂, aₙ = aₙ₋₁ + n. Check on first few terms.
  5. Compare against memorized sequences (powers, factorials, Fibonacci, Catalan, triangular).
  6. Check for interleaving: is the sequence two simpler sequences alternated together? Pull out odd-indexed and even-indexed terms separately and apply 1–5 to each half.

Most interviewers expect you to reach the answer in 30–60 seconds. If you're still stuck after a minute, talk through what you've ruled out — interviewers grade reasoning as much as the answer.

How to Practice This Effectively

Reading patterns isn't enough — you need recognition speed. Two suggestions:

  • Tag your practice problems. Every problem you solve, write a one-line note: "this was a sliding-window window-tightening problem", "this was a state-based run-length recurrence". After 30–40 problems you'll start seeing the same dozen patterns over and over.
  • Time the recognition, not just the solve. Many interviews are 30 minutes; if you spend 15 figuring out which pattern applies, you have no time to implement. Set a timer: "I have 90 seconds to classify this before I write code."

For a deeper bench of practice problems organized by category, the interview question bank on this site groups problems by exactly the patterns above. For broader prep including stochastic calculus, statistics, and market intuition, the resources hub has a structured curriculum.

The interviewer is rarely looking for novelty. They want to see you slot the problem into a known category quickly, defend why that category applies, then execute cleanly. Master these fourteen patterns and you've covered the great majority of what gets asked.