Fin Maverick
Foundations VocabularyAccounting & ReportingEconomics & MacroQuant Methods & ProgrammingBusiness & Company AnalysisCorporate Finance & ValuationBehavioural Finance
Banking & Market InfrastructureFixed Income & RatesDerivatives & Structured ProductsPublic EquitiesTransactions & DealsPortfolio ConstructionFunds & AMCs
Private Markets & AlternativesRisk, Treasury & ControlAI & Digital FinanceStochastic Calculus & PricingWealth & Personal FinanceIndian Markets & RegulationProfessional Practice
Explore NISM prep
Series-I · Currency DerivativesSeries-II-A · RTAs (Corporate)Series-II-B · RTAs (Mutual Fund)Series-III-A · Compliance (Non-Fund)Series-III-C · Compliance (Fund)Series-IV · Interest Rates DerivativesSeries-V-A · Mutual Fund DistributorsSeries-V-B · Mutual Fund FoundationSeries-V-D · SIF DistributorsSeries-VI · Depository OperationsSeries-VII · Operations & Risk ManagementSeries-VIII · Equity DerivativesSeries-IX · Merchant BankingSeries-X-A · Investment Adviser (Level 1)Series-X-B · Investment Adviser (Level 2)Series-XII · Securities Markets FoundationSeries-XV · Research AnalystSeries-XVI · Commodity DerivativesSeries-XVII · Retirement AdviserSeries-XIX-A · Category I & II AIF DistributorsSeries-XIX-B · Category III AIF DistributorsSeries-XIX-C · AIF ManagersSeries-XIX-D · Category I & II AIF ManagersSeries-XIX-E · Category III AIF ManagersSeries-XXI-A · PMS DistributorsSeries-XXI-B · Portfolio ManagersSeries-XXIII · Social Impact AssessorsSeries-XXIV · AML & CFT in Securities Markets
Explore Bootcamps
Equity ResearchPortfolio ManagementMutual Fund MasteryInvestment Banking Analyst
Private Equity AnalystQuant & Hedge Fund AnalystBreaking Into VCFinancial Analyst Program
Risk Management ProgramPrivate Wealth ManagementDebt Capital MarketsDerivatives Foundation
Explore Free Courses

Equity Research6

Writing an Investment ThesisBuilding a Discounted Cash FlowReading an Annual Report FastReading a Sector Before a CompanySpotting Quality of Earnings Red FlagsBuilding a Revenue Forecast From Drivers

Portfolio Management3

Rebalancing: When, Why and What It CostsStrategic and Tactical Asset AllocationMeasuring Risk in a Portfolio

Mutual Fund Mastery3

Comparing Funds Without Being FooledHow a NAV Is Struck and Which Day You GetReading a Fund Factsheet Properly

Derivatives Unlocked4

Hedging a Real ExposureThe Greeks, PracticallyFutures, the Basis and What Moves ItReading an Option Payoff

AI For Finance2

Retrieval and Grounding for FinanceDocument Extraction in Finance

Breaking Into Quants4

Backtesting a StrategyHypothesis TestingCleaning Financial DataRegression for Finance

Breaking Into VC3

Sizing a MarketReading a Term Sheet as a FounderHow a Venture Round Actually Works

Financial Analyst Program4

Common Size and Trend AnalysisReading a Cash Flow StatementRatio Analysis That Says SomethingBuilding a Working Capital Schedule

Risk Management Program2

Credit Exposure and How It Is ReducedValue at Risk and What It Hides

Investment Banking Analyst3

Precedent Transactions and Why They DifferReading a Term Sheet StructurallyBuilding a Comparable Companies Table

Private Wealth Management3

Tax Aware Portfolio DecisionsBuilding a Client Risk ProfileGoal Based Planning Arithmetic

Debt Capital Markets3

Analysing an Issuer's CreditDuration and What It Does Not Tell YouBond Pricing and Yield Mechanics

Private Equity Analyst2

Fund Waterfalls and CarryThe LBO in Structure

Hedge Funds Analyst2

Short Selling MechanicsLong Short Mechanics
QuarksCourses
Explore Interview Preparation
Investment BankingEquity ResearchVenture CapitalistPrivate EquityHedge Funds
QuantFinancial AnalysisPrivate Wealth ManagementDebt Capital MarketsRisk Management
Derivatives FoundationPortfolio ManagementMutual Fund Mastery
PartnershipsShowdown
Log inSign up
Interview tracksAll
1Investment Banking
Question bankPuzzlesCase studies
2Equity Research
Question bankPuzzlesCase studies
3Venture Capital
Question bankPuzzlesCase studies
4Private Equity
Question bankPuzzlesCase studies
5Hedge Funds
Question bankPuzzlesCase studies
6Quant
Question bankPuzzlesCase studies
7Financial Analysis
Question bankPuzzlesCase studies
8Private Wealth Management
Question bankPuzzlesCase studies
9Debt Capital Markets
Question bankPuzzlesCase studies
10Risk Management
Question bankPuzzlesCase studies
11Derivatives Foundation
Question bankPuzzlesCase studies
12Portfolio Management
Question bankPuzzlesCase studies
13Mutual Fund Mastery
Question bankPuzzlesCase studies

Quant puzzles, solved step by step

Puzzles
100
Traced to a firm
71
Topics
12
Hard
30
Topic
All topicsLogic and algorithmic reasoning10Conditional probability and Bayes7Counting and combinatorics8Continuous and geometric probability9Correlation, regression and linear algebra9Market making, betting and sizing9Expected value and optimal stopping9Statistics and estimation9Pricing, options and index maths7Games and strategic reasoning8Markov chains and random walks7Mental maths and number sense8
Level
AnyWarm upCoreHard
Source
AnyReported at a firmStandard
Showing 31–33 of 33 · filtered from 100Clear filters
  1. 096A desk's daily P&L in Rs lakh over seven days is -1, 2, 4, -9, 8, -2, 3. Which run of consecutive days has the largest total, and how do you find it in one pass through the data?Logic and algorithmic reasoningCoreWolverine TradingChicago · 2014

    Try it first

    Which run has the largest total?

    Show the worked solution

    Days 5 to 7, the run 8, -2, 3, which totals Rs 9 lakh. Walk through the days keeping the best total of a run ending today: either today alone or today added to yesterday's best run, whichever is larger. Record the largest value you see. The run 2, 4 looks attractive but totals only 6, and the -9 day makes it pointless to carry anything before it.

    How do you find the best run without checking every start and end day?

    Picture walking along a road with toll booths that either pay you or charge you. You may choose where to start and stop collecting. If the purse you have carried from earlier booths is in the red, the sensible move is to drop it and start fresh at the next booth. A run ending today is worth extending from yesterday only if the best run ending yesterday is positive; if it is negative it can only drag today down, so today starts a new run. That rule looks at each day once. Checking every pair of start and end days means 28 runs for seven days and 31,375 for a trading year of 250 days.

    Carry yesterday's run only while it is positive: the best run totals 9-1+2+4-9+8-2+3P&L, Rs lakhbest run: 8 - 2 + 3 = 9tempting: 2 + 4 = 6best ending today-126-3869best so far-1266889day1234567restart: yesterday's -3 is dropped
    Carrying the best run forward only while it is positive, the running total drops to -3 after the loss of 9 and restarts at 8 on day 5, so the best run is 8, -2, 3 with a total of 9, ahead of the tempting run 2, 4 at 6.
    The relationship
    ct=max⁡(xt,  ct−1+xt),best=max⁡tctc_t = \max(x_t,\; c_{t-1} + x_t), \qquad \text{best} = \max_t c_t
    x_tthe P&L on day t
    c_tthe best total of a run that ends on day t
    bestthe largest c_t seen so far
    What it says in wordsThe best run ending today either starts today or extends the best run ending yesterday; keep whichever is bigger, and remember the biggest.
    DayP&LBest run ending todayBest so far
    1-1-1-1
    2222
    3466
    4-9-36
    5888
    6-268
    7399
    Running the rule day by day, the best run ending today drops to -3 after day 4, restarts at 8 on day 5 and reaches 9 on day 7, which is the answer.

    Why does the tempting run 2, 4 lose?

    Because one later day beats it on its own. After the -9, the best run ending on day 4 is 6 - 9 = -3, so the rule drops the past and day 5 starts fresh at 8. The -2 on day 6 dips the run to 6, but the 3 on day 7 lifts it to 9. The best run can contain a losing day: 8, -2, 3 beats 8 alone because the day after the loss more than repays it. A candidate who stops a run at the first red day misses this, and the brute-force check over all 28 runs confirms 9 is the maximum.

    What edge cases does the interviewer probe?

    Three. If every day is a loss, the answer should be the least bad single day, so start the best at the first day's value, not at zero, or you will report an empty run worth 0. To report which days, store the start index whenever you restart and copy it when you record a new best. The same pass with the signs flipped finds the worst run, here -9, the single -9 day. The limitation on a desk is that the best run in hindsight is a selected statistic: a strategy that is judged by its best stretch will always look better than it trades.

    Where candidates lose it

    The quick wrong answer is the run 2, 4, because it is the first good stretch. The 8 on day 5 beats it alone, and carrying 8 through -2 and 3 beats 8.

    The second loss is in the code: starting the best total at zero, which reports 0 for a week of all losses, or restarting at every losing day instead of only when the running total itself turns negative. State the rule exactly: carry yesterday's run only while it is positive.

    What the interviewer asks next

    • Return the start and end days of the best run, not just its total.
    • What does your code return if every day in the series is a loss?
    • Find the best run if you may skip at most one day inside it.

    Asked at Wolverine Trading, Quantitative Research, Chicago, 2014 (Wall Street Oasis): Develop an algorithm to find out the section that contains the maximum sum.

  2. 098Two traders' monthly P&L are independent and normal. A has mean Rs 10 lakh and standard deviation Rs 3 lakh; B has mean Rs 8 lakh and standard deviation Rs 4 lakh. What is the probability that A out-earns B in a given month?Statistics and estimationCoreDRWLondon · 2025

    Try it first

    Pick the probability that A earns more than B in a month.

    Show the worked solution

    About 65.5%. The gap A - B is normal with mean 10 - 8 = Rs 2 lakh and variance 3^2 + 4^2 = 25, so its standard deviation is Rs 5 lakh. A out-earns B when the gap is positive, and zero sits 2/5 = 0.4 standard deviations below the mean, so the probability is Phi(0.4), about 65.5%. The better trader loses about one month in three.

    Why do the variances add when you subtract?

    You and a colleague set off for the same meeting from different places, and each journey is uncertain by a few minutes. The gap between your two arrival times is more uncertain than either journey, not less, because either of you can be the late one. Subtracting an independent random amount adds its noise, so Var(A - B) = Var A + Var B = 9 + 16 = 25, and the gap's standard deviation is 5, not 1. The mean subtracts as you would expect, 10 - 8 = 2. The gap is normal because a difference of independent normals is normal.

    Subtracting adds noise: the gap A - B has mean 2 and sd 5-505101520A: 10, sd 3B: 8, sd 4monthly P&L, Rs lakh-10-5051015A wins:65.5%B wins: 34.5%mean 2, sd sqrt(9 + 16) = 5gap A - B, Rs lakh; zero is 0.4 sd below the mean
    The two traders' monthly P&L overlap heavily, and the gap A - B has mean 2 and standard deviation 5, so the area above zero where A wins is only 65.5%, leaving B ahead in 34.5% of months.
    The relationship
    A−B∼N ⁣(μA−μB,  σA2+σB2)=N(2, 25),P(A>B)=Φ ⁣(25)=Φ(0.4)≈0.655A - B \sim N\!\left(\mu_A - \mu_B,\; \sigma_A^2 + \sigma_B^2\right) = N(2,\, 25), \qquad P(A > B) = \Phi\!\left(\frac{2}{5}\right) = \Phi(0.4) \approx 0.655
    mu_A, mu_Bthe mean monthly P&L, 10 and 8
    sigma_A, sigma_Bthe standard deviations, 3 and 4
    Phithe standard normal cumulative distribution
    What it says in wordsThe gap's mean is the difference of the means, its variance the sum of the variances, and the answer is how many standard deviations zero sits below that mean.

    How much does a longer comparison window help?

    A lot, and at a predictable rate. Over a quarter of independent months the total gap has mean 6 and standard deviation 5 x sqrt(3), about 8.7, so A comes out ahead with probability 75.6%. Over a year the mean is 24 and the standard deviation 5 x sqrt(12), about 17.3, so the probability is 91.7%. The edge grows with the number of months and the noise with its square root, so the z-score grows with the square root of time. A risk manager who ranks traders on one month of P&L is ranking mostly noise.

    What if the two traders' P&L are correlated?

    Then the shared part cancels in the gap. With correlation 0.5, the variance is 9 + 16 - 2 x 0.5 x 3 x 4 = 13, a standard deviation of 3.61, and A wins with probability 71.0%. Positive correlation makes the comparison sharper because common market moves drop out of the difference; negative correlation does the opposite. The limitation is the normal assumption: real P&L has fat tails and skew, and if one trader earns through rare large months, the month-by-month win rate can disagree with the mean, so check the shape before trusting the 65.5%.

    Where candidates lose it

    The commonest slip is subtracting the standard deviations, 4 - 3 = 1, which makes A look almost certain to win at 97.7%. Noise does not cancel when you subtract independent variables; it adds.

    The second loss is subtracting the variances, 16 - 9, or adding the standard deviations, 3 + 4. Square, add, then take the root: sqrt(9 + 16) = 5. The answer is then a z-score of 0.4, and Phi(0.4) is about 0.655.

    What the interviewer asks next

    • What is the probability that A out-earns B over a full year of independent months?
    • If their monthly P&L has correlation 0.5, what is the answer?
    • What is the probability that A out-earns B by more than Rs 5 lakh in a month?

    Asked at DRW, Trading, London, 2025 (Wall Street Oasis): technical interview based on normal distribution and market making

  3. 100You regress a centred target y on one standardised feature x with no intercept. The sum of x squared is 100 and the sum of x times y is 80. What is the OLS slope, and what is the ridge slope with penalty lambda = 25?Correlation, regression and linear algebraCoreCSCitadel SecuritiesLondon · 2026

    Try it first

    Pick the pair.

    Show the worked solution

    OLS gives 0.8 and ridge gives 0.64. OLS minimises squared error and its slope is the sum of xy over the sum of x squared, 80/100. Ridge adds lambda times the slope squared to the loss, which puts lambda into the denominator: 80/(100 + 25) = 0.64. That is the OLS slope times 100/125 = 0.8, so ridge shrinks the slope towards zero but never to zero.

    Where does lambda end up in the formula?

    Think of a new analyst's forecast that you half trust: you do not discard it, you shade it towards zero, and the less data behind it the more you shade. Ridge does that mechanically. It minimises the squared errors plus lambda times the slope squared; setting the derivative to zero gives b = Sxy/(Sxx + lambda). Penalising the size of the slope acts exactly like adding observations whose x squared totals lambda and whose y is zero, data that say the slope is zero. With 100 of real evidence and 25 of make-believe evidence, the slope is 80/125 = 0.64.

    Ridge divides the slope down; lasso subtracts it to exactly zero0501001502002503000.20.40.60.8penalty lambdaOLS 0.8lambda 25:ridge 0.64lambda 100: 0.40, half of OLSlasso hits 0 at 160ridge: 80 / (100 + lambda)lasso: (80 - lambda/2) / 100
    The ridge slope 80/(100 + lambda) falls from the OLS value 0.8 to 0.64 at lambda 25 and 0.40 at lambda 100 without ever reaching zero, while the lasso slope falls in a straight line and hits exactly zero at lambda 160.
    The relationship
    b^ridge=arg⁡min⁡b∑i(yi−bxi)2+λb2=∑xiyi∑xi2+λ=80125=0.64=0.8×100125\hat b_{\text{ridge}} = \arg\min_b \sum_i (y_i - b x_i)^2 + \lambda b^2 = \frac{\sum x_i y_i}{\sum x_i^2 + \lambda} = \frac{80}{125} = 0.64 = 0.8 \times \frac{100}{125}
    sum x_i y_ithe cross-product of feature and target, 80
    sum x_i^2the sum of squares of the feature, 100
    lambdathe ridge penalty, 25
    What it says in wordsRidge is OLS with lambda added to the sum of squares, so every slope is multiplied by Sxx/(Sxx + lambda).

    Why would you want a slope that is biased towards zero?

    Because a smaller, steadier estimate can be closer to the truth on average. Suppose the true slope is 0.5 and the noise variance is 25. OLS is unbiased but its variance is 25/100 = 0.25. Ridge at lambda 25 has variance 0.16 and a bias of -0.1, so its mean squared error is 0.17. Ridge trades a little bias for a larger cut in variance, and when the signal is weak relative to the noise that trade wins. In this one-feature case the best lambda is noise variance over slope squared, 100, which halves the slope and cuts the error to 0.125. In practice the truth is unknown, so lambda is chosen by cross-validation.

    lambdaSlope on this dataVarianceBias squaredMean squared error
    00.800.25000.00000.2500
    250.640.16000.01000.1700
    1000.400.06250.06250.1250
    Assuming a true slope of 0.5 and noise variance 25, ridge at lambda 25 and 100 has a lower mean squared error than OLS because the drop in variance outweighs the bias it adds.

    How does lasso differ?

    Lasso penalises lambda times the absolute slope instead. In one dimension that subtracts lambda/2 from the cross-product rather than adding to the denominator: (80 - 12.5)/100 = 0.675 at lambda 25, and exactly zero once lambda reaches 160. Ridge scales coefficients down; lasso shifts them down and can set them to exactly zero, which is why lasso selects features and ridge does not. Both penalties depend on the scale of x, which is why the feature must be standardised first; with correlated features, ridge spreads the weight across them while lasso tends to keep one.

    Where candidates lose it

    The fast wrong answer subtracts the penalty from the slope or from the numerator, which is lasso's mechanics, not ridge's. Ridge adds lambda to the sum of squares in the denominator, so the slope is scaled, not shifted.

    The second loss is saying ridge is always better because it has lower variance. It trades variance for bias; if the true slope is large and the data plentiful, shrinking costs more in bias than it saves. Say that lambda is chosen by cross-validation, not by taste.

    What the interviewer asks next

    • What value of lambda halves the OLS slope?
    • With two highly correlated features, how do ridge and lasso split the weight between them?
    • Why must features be standardised before applying a ridge penalty?

    Asked at Citadel Securities, Quantitative Research, London, 2026 (Wall Street Oasis): very detailed and difficult questions about regularisation ridge and lasso

← PreviousPage 4 of 4
  1. 1
  2. …
  3. 3
  4. 4
Next →
Fin Maverick

Finance education that ends in a job, not a certificate that gathers dust. Built for young India.

LEARN
CalculatorsFrameworksComparisonsInterview RoadmapsShowdown
RESOURCES
All CoursesFree CoursesBootcampsInternships
COMPANY
AboutJob openingPartnership
LEGAL
Privacy PolicyTerms & ConditionsContent LicenseReturn & Refund Policy
© 2026 FIN MAVERICK / BUILT FOR INDIA.DO FINANCE, DO NOT JUST READ ABOUT IT.