Problem archive
Quant interview problems
504 interview-style problems, each with hints and a worked solution.
Probability (108)
- The Birthday Collision · Easy
- Three Heads Before Three Tails · Easy
- Two Heads in Three Flips · Easy
- At Least One Six · Easy
- Sum of Eight · Easy
- Matching Ranks · Easy
- Even Prime Sum · Easy
- Two Winning Trades · Easy
- More Heads Than Tails · Medium
- First Ace at Card 14 · Medium
- Fixed Points of a Permutation · Medium
- Birthday Coincidence · Medium
- Two Red Balls · Easy
- Even Rolls Until Six · Medium
- Higher Card Wins · Medium
- Rolling Doubles · Easy
- Ratio of Uniforms · Medium
- Median of Three Uniforms · Medium
- Average of Three Uniforms · Hard
- Extremes of n Uniforms · Medium
- Max Below a Threshold · Easy
- Minimum of Exponentials · Medium
- Race of Two Exponentials · Medium
- Inverse Transform Sampling · Medium
- Broken Stick Triangle · Medium
- Diagnostic Test Bayes · Medium
- Two Boxes of Balls · Easy
- First Ace Position · Hard
- First Ace to Appear · Easy
- Dice Sum Conditional · Easy
- Fair Coin or Two-Headed · Medium
- Urn Conditional Draw · Medium
- Fruit Basket Depletion · Hard
- Monty Hall Switch · Easy
- Face Card Color · Medium
- Landing at Plus Two · Medium
- Gambler's Ruin Odds · Hard
- Mayor's Rope Cut · Hard
- Stable Round Table · Medium
- Even Die, Even Sum · Medium
- Order Statistic Expectation · Hard
- Median of Three Uniforms · Hard
- Silent Half Hour · Medium
- Uniform Arrival Time · Hard
- Memoryless Wait · Medium
- Reciprocal Jensen Gap · Hard
- Binary Payout Fair Value · Easy
- No Consecutive Heads · Easy
- Exactly One Ace · Medium
- Every Room Occupied · Medium
- Three Different Suits · Medium
- Separation in a Line · Medium
- Non-Attacking Rooks · Hard
- Even Digits in a Code · Medium
- Which Coin Was Chosen? · Medium
- Defective Product Source · Medium
- Conditional Relative Ordering · Medium
- Exactly One Ace Given At Least One · Medium
- Previous Draw Given Current Color · Medium
- Reinforced Urn · Medium
- Conditional Dice Maximum · Medium
- Conditional Geometric Time · Medium
- Expected Gap Between Two Uniforms · Medium
- Small Triangle in the Unit Square · Easy
- Two Uniforms Smaller Than a Third · Hard
- Competing Exponentials · Medium
- Poisson Thinning of Order Flow · Medium
- Conditional Poisson Arrival Locations · Hard
- Three Heads in Four Flips · Easy
- At Least One Six in Three Rolls · Easy
- Dice Sum of Nine · Easy
- Matching Parity of Two Dice · Easy
- Three Cards of the Same Suit · Medium
- Exactly Two Hearts in Five Cards · Medium
- First Ace at Position Ten · Medium
- Waiting More Than Five Flips · Easy
- First Head on Flip Four · Easy
- Divisible by Two or Five · Easy
- Same Parity Without Replacement · Medium
- Relative Order of Three Objects · Easy
- Which Variable Is Largest · Easy
- Doubles Given a Large Sum · Medium
- Three Possible Sources · Medium
- Truncated Geometric Distribution · Medium
- Exactly One Birthday Pair Among Four · Hard
- Repeated Digit in a Random Code · Easy
- Exactly Two Red Balls · Easy
- Exactly One Red, Conditionally · Medium
- Uniform Inequality · Medium
- Distance Between Two Uniforms · Medium
- Median Below One Half · Medium
- Exponential Race · Medium
- At Least Two Successes · Medium
- Even Roll · Easy
- Three Heads in Four Flips · Easy
- Two Dice Summing to Seven · Easy
- Two Aces · Easy
- Union of Independent Events · Medium
- Six Given Even · Medium
- Expected Tosses to First Head · Medium
- First Six on the Third Roll · Medium
- Different Colours · Medium
- Two Uniforms Above One · Medium
- Positive Test, Rare Disease · Medium
- Sum 8 Given a Six · Hard
- Expected Position of the First Ace · Hard
- Two Heads Given at Least One · Hard
- Sum Above One Given a Large X · Hard
Combinatorics (60)
- Balanced Committee · Easy
- Adjacent Aces · Hard
- No Correct Letter · Easy
- Restricted Team Formation · Medium
- Boxes With Minimums · Easy
- Four Boxes, Min Three · Easy
- Non-Adjacent Books · Easy
- MISSISSIPPI Arrangements · Easy
- Committee With Alice or Bob · Easy
- No Empty Box · Hard
- Non-Adjacent Ones · Medium
- Round Table Seating · Easy
- Two-Ace Hands · Medium
- Even Face Distribution · Medium
- Even Grid Sums · Hard
- Unlabeled Team Split · Medium
- Alternating Seating · Medium
- Bounded Integer Solutions · Easy
- Lattice Path Count · Medium
- Straight But Not Flush · Medium
- No Couples Adjacent · Hard
- Relative Order · Easy
- Equal Team Allocation · Easy
- Non-Consecutive Selection · Medium
- Even Coordinate in Stars and Bars · Hard
- Committees of Three · Easy
- Arranging Seven Books · Easy
- Circular Table for Six · Easy
- Seven in a Line, Adjacent · Easy
- Seven in a Line, Not Adjacent · Medium
- Arrangements of BANANA · Easy
- Balls Into Boxes, Empty Allowed · Easy
- Balls Into Boxes, None Empty · Easy
- Bounded Integer Solutions · Medium
- Mixed Lower Bounds · Medium
- Non-Consecutive Selection · Medium
- Binary Strings, Three Isolated Ones · Medium
- Five-Digit Codes, No Repeats · Easy
- Five-Digit Integers, No Repeats · Medium
- Committee With At Least One of Two · Medium
- Committee With Exactly One of Two · Medium
- Pairing Ten People · Hard
- Teams of Three Sizes · Medium
- No Room Left Empty · Hard
- Derangements of Five Objects · Medium
- Alternating Circular Seating · Medium
- Lattice Paths to (5,3) · Easy
- Lattice Paths Below the Diagonal · Hard
- Six People, Four Rooms, None Empty · Hard
- Each Face Exactly Three Times · Medium
- Choosing Three of Ten · Easy
- Books on a Shelf · Easy
- Binary Strings With Two Ones · Medium
- Stars and Bars for Seven · Medium
- Arrangements of LEVEL · Medium
- Four-Digit PINs · Medium
- Four-Card Hands · Medium
- Round Table, Two Together · Hard
- Onto Functions to Two Values · Hard
- Bounded Stars and Bars · Hard
Expected Value (48)
- Maximum of Three · Medium
- Minimum of Three Dice · Hard
- Expected Max of Two Dice · Medium
- Expected Min of Two Dice · Medium
- Two in a Row · Medium
- Racing to Heads · Hard
- Collecting All Faces · Medium
- Occupied Boxes · Medium
- Tetrahedral Dice Duel · Hard
- Dice Streak Threshold · Hard
- Symmetric Walk Mean · Easy
- Waiting for Sixes · Easy
- Pattern Waiting Times · Hard
- Reroll or Keep · Medium
- Two Rerolls Allowed · Hard
- Inversions in Shuffles · Medium
- Empty Seats Occupancy · Hard
- Consecutive Values Become Neighbours · Medium
- Waiting for HT · Medium
- Waiting for HTH · Hard
- Adjacent Equal Coin Flips · Easy
- Records in a Random Permutation · Hard
- Birthday Collision Pairs · Medium
- Paying for a Reroll · Medium
- Waiting for Two Specific Faces · Medium
- Sum Before the First Six · Medium
- Maximum of Two Exponentials · Hard
- Expected Heads in Twenty Flips · Easy
- Expected Heads with a Biased Coin · Easy
- Expected Sum of Ten Dice · Easy
- Expected Absolute Difference of Two Dice · Medium
- Distinct Faces in Three Rolls · Medium
- Expected Empty Boxes · Medium
- Coupon Collector for a Four-Sided Die · Medium
- Waiting for a Rare Success · Easy
- Waiting for HH · Medium
- Reroll on an Eight-Sided Die · Medium
- Paying to Reroll a Ten-Sided Die · Hard
- Inversions in an Eight-Element Permutation · Medium
- Records Among Ten Values · Hard
- Adjacent Equal Pairs in Twelve Flips · Medium
- Collision Pairs Among Balls · Medium
- Random Walk Mean After Twenty Steps · Easy
- Second Moment of the Walk · Medium
- Expected Failures Before Success · Easy
- Expected Trials for Three Successes · Medium
- One Chance to Redraw a Uniform · Medium
- Expected P&L of a Two-Outcome Strategy · Easy
Statistics (57)
- Precision of the Mean · Easy
- Sum of Independent Normals · Easy
- Covariance With a Sum · Medium
- MLE for Uniform Support · Hard
- Total Variance Split · Hard
- Correlated Sum Variance · Medium
- Two Million VaR · Medium
- Zero Covariance Without Independence · Medium
- Beta-Binomial Posterior Update · Medium
- Population Regression Coefficient · Easy
- Eigenvalues of a Symmetric 2x2 Matrix · Easy
- Positive Definiteness of a 2x2 Symmetric Matrix · Medium
- Orthogonal Projection onto a Line · Medium
- Rank of an Outer Product · Easy
- Eigenvalues From Trace and Determinant · Medium
- Minimum Norm Under a Linear Constraint · Easy
- Cobb-Douglas Resource Allocation · Medium
- Gradient of a Quadratic Form · Medium
- Minimum-Variance Portfolio Weight · Hard
- Look-Ahead Bias in Backtesting · Medium
- Expected False Positives Under Multiple Testing · Medium
- Optimization Behind the First Principal Component · Hard
- Primary Effect of Severe Multicollinearity · Medium
- Why Shuffling Breaks Time-Series Cross-Validation · Medium
- Definition of Weak Covariance Stationarity · Medium
- Meaning of Cointegration · Hard
- Why Selecting the Best Backtested Rule Overstates Performance · Medium
- Sum of Two Independent Normals · Easy
- Linear Transformation of a Normal · Easy
- Covariance of Two Linear Functions · Medium
- Correlation Between a Variable and Its Sum · Medium
- MLE of a Bernoulli Parameter · Easy
- MLE of an Exponential Rate · Medium
- MLE of a Normal Mean · Easy
- MLE Denominator for Normal Variance · Medium
- Variance of the Sample Mean · Easy
- Large-Sample Distribution of the Sample Mean · Easy
- Beta-Bernoulli Posterior Update · Medium
- Posterior Mean of a Beta Distribution · Easy
- Mean and Variance of a Poisson · Easy
- Mean and Variance of an Exponential · Easy
- Mean of a Geometric Waiting Time · Easy
- Mean of a Uniform Distribution · Easy
- Variance of a Uniform Distribution · Easy
- CDF of the Maximum of Uniforms · Medium
- Expected kth Order Statistic of Uniforms · Medium
- Law of Total Variance Application · Hard
- Law of Total Expectation Application · Medium
- One-Day Value at Risk, Second Instance · Easy
- Mean of Four Numbers · Easy
- Variance of a Coin Indicator · Easy
- Binomial Mean and Variance · Medium
- Poisson Zero · Medium
- Normal Below Its Mean · Medium
- Variance of a Difference · Medium
- Correlation From Covariance · Medium
- Variance of a Sample Mean · Hard
Stochastic Processes (27)
- Covariance of Brownian Motion · Medium
- Brownian Motion Exit Probability · Hard
- Expected Level of Geometric Brownian Motion · Medium
- Exponential Brownian Martingale · Hard
- Two-State Markov Chain Stationary Distribution · Medium
- Superposition of Two Poisson Processes · Easy
- Marginal Distribution of Brownian Motion · Easy
- Distribution of a Brownian Increment · Easy
- Covariance of Two Brownian Times · Easy
- Symmetry of Brownian Motion · Easy
- Second Moment of Brownian Motion · Easy
- A Quadratic Brownian Martingale · Medium
- Expected Exit Time of Brownian Motion · Hard
- Log-Normality of Geometric Brownian Motion · Medium
- Discounted GBM as a Martingale · Medium
- Poisson Process Counts · Easy
- Interarrival Times of a Poisson Process · Easy
- Superposition of Two Rate-Specific Poisson Processes · Easy
- Uniform Order Statistics From a Poisson Process · Hard
- General Two-State Stationary Distribution · Hard
- Expected Absorption Time in Gambler's Ruin · Hard
- Covariance Stationarity of an AR(1) Process · Medium
- Variance of a Stationary AR(1) Process · Medium
- Autocorrelation of a Stationary AR(1) Process · Medium
- Expected Time to the nth Poisson Arrival · Easy
- Exponential Wait Over Ten Minutes · Hard
- Random Walk Back at Zero · Hard
Brain Teasers (53)
- Two Fragile Objects, One Hundred Floors · Hard
- Finding a Heavier Coin Among Nine · Medium
- Survivor of the Josephus Circle · Hard
- Three Switches, One Visit · Easy
- Eight Balls, One Heavy · Easy
- Burning Ropes for 45 Minutes · Easy
- Four Liters From 3 and 5 · Easy
- Snail in a Well · Easy
- Clock Angle at 3:15 · Easy
- Machines and Widgets · Easy
- Bat and Ball · Easy
- Three Sandwiches, Two Fathers, Two Sons · Easy
- Doubling Lily Pads · Easy
- Twelve Coins Lower Bound · Medium
- Eighty-One Coins, One Light · Medium
- Twenty-Seven Coins, One Heavy · Medium
- Sixteen Bottles, One Round · Medium
- One Hundred Lockers · Medium
- Mutilated Chessboard · Medium
- Matching Socks · Medium
- Shared Birth Month · Medium
- Overlapping Clock Hands · Medium
- Squares in a Grid · Medium
- Bridge and Flashlight · Medium
- Twenty-Five Horses · Medium
- Two Eggs, Thirty-Six Floors · Medium
- Two Black, Two White Hats · Medium
- Painted 4x4x4 Cube · Medium
- Party Handshakes · Medium
- One Liter From 3 and 5 · Medium
- Three Pizza Cuts · Medium
- A Slow Clock · Medium
- Unpainted Cubes in 3x3x3 · Medium
- One Hundred Prisoners and Boxes · Hard
- The Last Airplane Seat · Hard
- One Thousand Bottles · Hard
- Toggling the Divisors of 60 · Hard
- Taking 1 to 3 Stones From 21 · Hard
- Taking 1 to 4 Stones From 100 · Hard
- Diagonals of a 20-gon · Hard
- Necklace With One Red Bead · Hard
- Chords of Ten Points · Hard
- Removing Opposite Colours · Hard
- 19 Times 21 · Easy
- Fifteen Percent of 240 · Easy
- 48 Squared · Easy
- One Eighth as a Percent · Easy
- 997 Times 1003 · Medium
- 125 Times 64 · Medium
- One Seventh to Three Decimals · Medium
- Up 20 Then Down 20 · Medium
- Difference of Squares · Medium
- 999 Squared · Hard
Market Making (62)
- Uninformed Spread Profit · Easy
- Adverse Selection Quotes · Hard
- Kelly Bet Sizing · Hard
- Kelly Sizing With Non-Even Odds · Hard
- Kelly Fraction for an Even-Money Bet, Second Instance · Medium
- Kelly Fraction With Net Odds, Second Instance · Hard
- Uninformed Spread Profit, Second Instance · Easy
- Midpoint and Spread of a Quote · Easy
- Recovering the Ask · Easy
- Round Trip Through the Spread · Easy
- Inventory After a Customer Buy · Easy
- Covering Part of a Short · Easy
- Spread in Basis Points · Easy
- Two Customers, Both Sides · Easy
- Picked Off on a Stale Quote · Easy
- Realized P&L on a Round Trip · Easy
- Half-Spread in Basis Points · Easy
- Fair Value of a Binary Payoff · Medium
- Selling Above Expected Value · Medium
- Buying a Coin-Flip Asset · Medium
- Edge Times Size · Medium
- One Order, Asymmetric Arrival · Medium
- Losing to Informed Flow · Medium
- Expected P&L With No-Trade Intervals · Medium
- Break-Even Against Mixed Buyers · Medium
- Bid Against Informed Sellers · Medium
- Mark-to-Market After Uneven Fills · Medium
- Ending Inventory · Medium
- Chained Inventory Updates · Medium
- Average Acquisition Cost · Medium
- Mark-to-Market on a Long · Medium
- Mark-to-Market on a Short · Medium
- Partial Fills on Both Sides · Medium
- Basis-Point Spread · Medium
- Quoting a Target Spread · Medium
- Uneven Flow Over a Session · Medium
- Expected P&L of Two Outcomes · Medium
- Break-Even Informed Fraction · Medium
- Spread Revenue Net of Adverse Selection · Medium
- Inventory-Adjusted Reservation Price · Medium
- Reservation Price Across Inventories · Medium
- Quoting Around a Reservation Price · Medium
- Skewing a Quote · Medium
- Choosing a Bid by Fill Probability · Medium
- Choosing an Ask by Fill Probability · Medium
- Expected P&L With Execution Risk · Medium
- Expected P&L and Inventory Drift · Hard
- Minimum Spread Against Information · Hard
- Asymmetric Flow and Information · Hard
- Break-Even Ask · Hard
- Break-Even Bid · Hard
- Losing on One Side Only · Hard
- Covered Call Payoff in Two States · Hard
- Variance of Mark-to-Market P&L · Hard
- Mean and Variance of Independent Trades · Hard
- Bid Selection With Conditional Values · Hard
- Smallest Safe Half-Spread · Hard
- Mean-Variance Trade Choice · Hard
- Asymmetric Price Impact · Hard
- Ask Selection With Conditional Values · Hard
- Interval P&L With Unequal Edges · Hard
- Bookkeeping a Trading Sequence · Hard
Derivatives & Risk (40)
- One-Period Call Value · Medium
- Broken Put-Call Parity · Medium
- Annualized Sharpe Ratio · Easy
- Beta-Neutral Futures Hedge · Medium
- Duration Price Sensitivity · Easy
- Delta-Neutral Share Count · Easy
- Two-Asset Portfolio Volatility · Medium
- Forward Price With a Dividend Yield · Easy
- Lower Bound for a European Call · Medium
- Duration Plus Convexity Approximation · Medium
- Triangular FX Arbitrage · Hard
- Minimum-Variance Hedge Ratio · Medium
- Call Price From Put-Call Parity · Medium
- Compounded Two-Period Return · Easy
- Limits of Square-Root Sharpe Scaling · Medium
- Forward Price With Cost of Carry · Easy
- Risk-Neutral Probability in a One-Period Tree · Medium
- Two-Asset Portfolio Volatility With Unequal Weights · Medium
- Minimum-Variance Weight, Second Instance · Hard
- Minimum-Variance Hedge Ratio, Second Instance · Medium
- Beta Hedge With Futures, Second Instance · Medium
- Duration-Only Price Sensitivity, Second Instance · Easy
- Duration Plus Convexity, Second Instance · Medium
- Bond Portfolio DV01 · Medium
- Continuously Compounded Zero-Coupon Bond Price · Easy
- Implied FX Cross Rate · Medium
- Annualized Sharpe Ratio, Second Instance · Medium
- Two-Asset Portfolio Volatility, Uncorrelated Case · Medium
- Delta-Neutral Share Count, Second Instance · Easy
- Checking Put-Call Parity, Second Instance · Medium
- Long Call Profit · Easy
- Long Put Profit · Easy
- Forward Payoff · Medium
- Forward Price With Continuous Rates · Medium
- Call Price From Parity · Medium
- Neutralizing Delta · Medium
- One-Day 95% VaR · Medium
- Delta-Gamma Approximation · Hard
- Combining Correlated Positions · Hard
- Bull Call Spread · Hard
Linear Algebra (22)
- Eigenvalues of a Symmetric 2x2 Matrix · Easy
- Trace From Eigenvalues · Easy
- Determinant From Eigenvalues · Easy
- Inverse of a 2x2 Matrix · Medium
- Orthogonal Projection of a Vector Onto a Line · Medium
- Condition for Orthogonal Vectors · Easy
- Positive Semidefiniteness of a Covariance Matrix · Medium
- Hessian of a Quadratic Form · Medium
- Minimizing Sum of Squares Under a Linear Constraint · Easy
- Maximizing a Product Under a Sum Constraint · Easy
- Cobb-Douglas Maximization With Unequal Exponents · Medium
- Maximizing a Geometric Mean Under a Weighted Constraint · Medium
- Normal Equations for Ordinary Least Squares · Easy
- Projection Matrix Onto a Column Space · Hard
- Eigenvalues of a Triangular Matrix · Easy
- Determinant of a Triangular Matrix · Easy
- Singular Values and A^T A · Medium
- First Principal Component Direction · Medium
- Rank-Nullity for a Map From R^7 · Easy
- Inverse of an Orthogonal Matrix · Easy
- Determinant of an Orthogonal Matrix · Medium
- Convexity and the Hessian · Medium
Coding (27)
- Coin Flips Needed to Simulate a Fair Die · Medium
- Worst-Case Binary Search Comparisons · Easy
- Probability an Item Is Kept in Reservoir Sampling · Hard
- Binary Search Comparisons for 1024 Elements · Easy
- Time Complexity of Merge Sort · Easy
- Probability of No Hash Collisions · Medium
- Two-Sum With a Hash Set · Easy
- Streaming kth Largest Element · Medium
- Complexity of Floyd's Cycle Detection · Medium
- Why Random Swaps Do Not Uniformly Shuffle · Medium
- Solving T(n) = 2T(n/2) + n · Medium
- Solving T(n) = T(n/2) + 1 · Easy
- Solving T(n) = T(n-1) + 1 · Easy
- Maximum Nodes in a Binary Tree of Bounded Depth · Easy
- Leaves and Internal Nodes in a Full Binary Tree · Medium
- Binary Heap Insertion Complexity · Easy
- Shortest Paths in an Unweighted Graph · Easy
- Edge Weight Requirement for Dijkstra's Algorithm · Easy
- Existence of a Topological Ordering · Easy
- Amortized Complexity of Union-Find · Hard
- Simulating a Five-Sided Die With Coin Flips · Medium
- Guaranteed Repeats by the Pigeonhole Principle · Easy
- Finding a Majority Element · Medium
- Final Inclusion Probability in k-Item Reservoir Sampling · Hard
- Expected Hash Table Lookup Complexity · Easy
- Maximum Edges in a Simple Graph · Easy
- Identifying a Tree by Edge Count · Easy