A series of returns turns up again and again in Squarepoint's data scientist questions: you code the maximum drawdown of a running PnL, work out what dropping the flat days does to a Sharpe ratio, and estimate a beta against a benchmark. Around that core sit short probability puzzles, counting and recurrence problems in code, a few finance definitions and linear regression. None of the reported questions is SQL, an A/B test or a product metric, so a plan built for a tech-company analytics loop would leave most of this material untouched. The Squarepoint data scientist question hub keeps the full list; this page is about what those questions share and how to work them.
Return series on one side, uniform random variables on the other
The questions divide fairly evenly between statistics and math on one hand and coding on the other, with two machine learning questions added, one on linear regression and one tying expectations and correlations to investment strategies. Each half carries two distinct themes, and it helps to keep them apart while you study.
On the coding side, the first theme is trading arithmetic on a single array. Candidates report a maximum drawdown function that must also say where the drawdown began and ended, the best profit from one buy and sell or from as many trades as you like, and coin change bundled into the same sitting. The second theme is counting and optimization with no finance in it: the number of ways to climb to step n when only certain step sizes are allowed, index triplets whose product is even under a modulus, the fewest moves to equalize an array when every move raises all elements except one, and selling limited stock to a line of customers for the most revenue.
On the statistics side, one theme is the statistics of returns and the vocabulary of markets: a Sharpe ratio computed with and without zero-return days, beta from aligned asset and benchmark returns, bonds set against common equity and dividends, and a question that runs from derivatives and yield to maturity into core statistics. The other theme is probability puzzles: two continuous ones with a picture behind them (the product of two uniform draws beating one half, the expected distance from the center for a point chosen uniformly in a disk) and a card game that restarts whenever it ties.
The regression question covers its assumptions, how to evaluate a fit and what adding a feature does.
Two things follow for your preparation. Finance literacy is part of the test even though the title says data scientist, so you need to discuss drawdown, Sharpe, beta, bonds and yields without stopping to recall definitions. And two of the three probability puzzles are continuous, so practice integrating over a region of the plane at least as much as counting arrangements of cards.
Assessment, coding round, finance round: what candidates describe
Each account below comes from one candidate, so read its details as single data points.
One candidate describes an online assessment of six items. The first four were short items on probability, statistics and reading a piece of code to state its time complexity, and one of them gave a scenario and asked which statistical bias it showed. That candidate found none of them hard and got through them quickly. The last two were coding problems, and the first, a store selling limited stock to a stream of customers, struck them as easy. The same account describes the questions as rotating, so treat the topics as the signal and the exact items as noise.
Another candidate describes a first round of three coding questions that opened with the step-counting problem, where a plain recurrence was enough. That interviewer was relaxed, happy to chat and willing to give hints, and the session felt like conversation while solving. If you get the same tone, use it: say your plan before you type, so a hint can arrive before you have gone far down a wrong path.
A different candidate's second round was with a quantitative researcher and pressed hard on finance and statistics. The same person cautions that their questions resembled those earlier candidates had described only in format. Practice the families, and expect the prompts themselves to differ. The full candidate interview reports for this role carry more detail.
Drawdown, best trade and coin change on one PnL array
The trading-array questions bundle two or three small functions into one session, and the trio of drawdown, single-trade profit and coin change appears in more than one report. What separates a good answer from a shaky one is precision about inputs and outputs, because these prompts spell out conventions and code is only correct if it honors them.
Before writing anything, settle these points out loud:
- Is the input cumulative PnL, per-period PnL or a price series? Drawdown on a running total and drawdown on daily changes are different functions.
- What sign does the drawdown carry, and what comes back when the series never falls?
- Which indices are wanted? One prompt defines exactly which position counts as the start, so read that definition twice.
- How are ties handled, such as two equal drawdowns or two equally good trades? Pick a rule and say it.
Then give the shape of the solution. The drawdown and trade-profit functions can each be done in one pass with constant extra memory by carrying a small amount of state forward from the prefix. Say what that state is and why nothing else about the prefix matters; that sentence is your correctness argument. Name the complexity and run four cases aloud: a series that only rises, one that only falls, a single element, and a V shape.
The many-trades variant changes the structure of the best answer, and the proof changes with it. Be ready to justify why your rule cannot be beaten, beyond showing that it gives the right number on one example. Common extensions of this family are a transaction fee, a cooldown day after selling or a cap of k trades. A small state machine with a holding state and a flat state covers all of them, and having that version ready costs little even when the first question is simpler.
Coin change hides a fork: the fewest coins that reach an amount, or the number of distinct ways to make it. Ask which. Both versions fill a table indexed by amount, so say which one you are building and what an unreachable amount returns.
Tie the code to the domain when you can. Maximum drawdown is the number a risk manager reads off a backtest, so one sentence on what it leaves out (how long the strategy stayed underwater, how often it happened) shows you know why anyone computes it.
Recurrences and counting: stairs, triplets and equal arrays
The second coding theme has no finance in it. These are counting and optimization puzzles where brute force is too slow and the real work is finding structure.
Step counting with an arbitrary set of step sizes is the coin change recurrence seen from another side, and the comparison is worth having ready. If order matters, so that one step then two differs from two then one, you are counting sequences; if order does not matter, you are counting combinations, and in a bottom-up table the only difference is which loop sits outside. Ask which is meant. Then ask about size. Counts grow fast, so expect a modulus, and if n is enormous a matrix power brings the work down to logarithmic time.
Counting index triplets by a property of their product rewards a different habit. Classify each element by the one feature that decides the property, count how many land in each class, and combine class sizes with a little combinatorics. Enumerating triples is cubic and rarely survives a follow-up on input size. Ask whether indices must be strictly increasing (i < j < k) and whether the count needs a modulus.
For the equalizing-moves question, resist simulating. Look for an invariant or an equivalent move that is easier to count, and argue both halves: that your count is reachable, and that nothing smaller is.
The inventory and revenue item from the assessment calls for a greedy argument. State the choice you make at each sale, then argue by exchange: if an optimal plan ever chose differently, swapping that sale would not lower revenue. A priority queue gives a correct simulation. After that, check the cost when customers vastly outnumber products, since selling one unit at a time is where a simulation gets slow.
Sharpe ratios with flat days, bonds against equity, and yields
Answering these takes exact returns arithmetic and fluent one-line definitions of basic instruments. The candidate whose second round was with a quantitative researcher describes it as heavy on finance and statistics.
The Sharpe question is a moments-of-a-mixture problem. Write the mean and variance of the full series in terms of the mean and standard deviation of its nonzero part and the share of zero days; the law of total variance does the bookkeeping. Keep population and sample conventions consistent, because a stray n against n minus 1 shifts the ratio in small samples and muddies a clean comparison. Then interpret: for a strategy that sits flat on many days, which version describes it honestly, and how does annualizing interact with the number of trading days? A short result followed by that discussion is far stronger than the algebra by itself.
The instrument questions are knowledge checks on bonds, common equity and dividends, derivatives, and yield to maturity. A data scientist coming from tech may never have needed these words. For each, prepare a one-sentence definition, a tiny numeric example you can do in your head, and one place it shows up in data, for instance an ex-dividend date appearing as a drop in an unadjusted price series. The example keeps a definition from sounding memorized and gives you footing when a follow-up digs in.
The question that covers yield to maturity also moves into core statistics, so keep the basics warm: unbiased estimators, the central limit theorem, confidence intervals, and what a p-value does and does not say.
Probability puzzles: products of uniforms, points in a disk, replayed ties
Three short puzzles carry most of the pure probability, and two of them reduce to measuring a region.
When a question draws numbers uniformly from an interval or a point uniformly from a shape, start with a sketch. The probability that two uniform draws satisfy a condition is the area of the part of the unit square where it holds, so draw the boundary curve first and decide which side you need. For an expectation tied to a shape, find the distribution of the quantity you care about before integrating: ask what fraction of the area lies below a given value, differentiate if you need a density, and pick coordinates that match the shape's symmetry. The classic trap is assuming that a derived quantity is uniform because the point is.
A game that is replayed on a tie has a restart structure. You can sum the geometric series over the number of tied rounds, or condition on the first decisive round; doing both takes a minute and catches algebra slips. When two players or two games are compared, compute both in the same form so the comparison is a single line.
Check every answer two ways before you say it. Bounds come first: a probability sits between 0 and 1, and an expected distance from a disk's center is less than the radius. Then a limiting case or a quick simulation. Here is the pattern on an unrelated question, the chance that two uniform draws sum to more than 1.5:
import random
trials = 1_000_000
hits = sum(random.random() + random.random() > 1.5 for _ in range(trials))
print(hits / trials) # close to 0.125, the corner triangle's area
The exact region is a triangle with legs of one half, so its area is one eighth, and a million trials land within about a thousandth of it.
For practice, change one thing after each puzzle and solve it again: the threshold, the number of variables, the shape (a square instead of a disk), or a payoff attached to the outcome so that you price a bet instead of quoting a probability.
Regression assumptions, market beta and correlated strategies
This section groups the regression question with beta and the strategy question, since all three come down to regression and covariance.
For the regression question, pair each assumption with two things: how you would detect a violation and what goes wrong if you ignore it. Returns data breaks the textbook in specific ways, so have examples ready, such as volatility that clusters in time, overlapping return windows that correlate the residuals, and a few extreme days that dominate a least-squares fit. On evaluation and on adding a feature, keep in-sample and out-of-sample results apart in every sentence.
Estimating beta from aligned returns is a regression of one return series on another, and the traps live in the data. The two series must cover the same dates, missing days must be handled the same way in both, the inputs must be returns and never prices, and variance and covariance must share one normalization. Say what you are doing about an intercept. Natural extensions are a rolling beta, how much a few outlier days move the estimate, and how beta and correlation differ for the same pair of assets.
The question tying expectations and correlations to investment strategies points at portfolio arithmetic. Be fluent with the variance of a weighted sum including its covariance terms, with what correlation does to diversification, and with the difference between expected value and risk-adjusted value. Write the general formula once, then substitute numbers.
An original problem: the losing streak a 55 percent strategy should expect
Here is a prompt in the same spirit that is not one of the reported questions. A strategy makes money on 55 percent of trading days, independently from one day to the next. Over a 250-day year, what is the probability of at least one run of five or more losing days? A risk manager proposes cutting the strategy's capital after five straight losses. How often would that rule fire on a strategy that is working?
Start by pinning down the setup. Losing means a negative day, there are no flat days, days are independent, and the event is at least one run of five or more consecutive losses somewhere in the 250 days. Call the daily loss probability q = 0.45.
Estimate before computing. A losing run of five starts on a given day when the day before was a win and the next five days are losses, which has probability about 0.55 * 0.45**5, roughly 0.0101. Across about 250 possible start days that is around 2.5 expected runs. Treating run starts as rare events, a Poisson approximation puts the chance of at least one run near 1 - exp(-2.54), about 0.92. Before any exact work you already know the answer is large, and that is the main insight.
For the exact answer, track the length of the current losing run. While no five-loss run has happened, the state is a run length from 0 to 4; a win sends any state back to 0, a loss moves state s to s + 1, and a loss from state 4 completes a run of five, which absorbs.
def prob_losing_streak(n_days, k, p_loss):
# alive[s]: probability the current losing run has length s and no run of k has happened yet
alive = [1.0] + [0.0] * (k - 1)
hit = 0.0
for _ in range(n_days):
nxt = [0.0] * k
nxt[0] = sum(alive) * (1 - p_loss)
for s in range(k - 1):
nxt[s + 1] = alive[s] * p_loss
hit += alive[k - 1] * p_loss
alive = nxt
return hit
print(prob_losing_streak(250, 5, 0.45)) # about 0.930
That runs in O(n * k) time and O(k) memory and returns about 0.930. A simulation of 100,000 years agrees to within a few thousandths, and the Poisson estimate was about one percentage point low, close enough to have told you the size of the answer before you wrote a line.
Now interpret it. The rule fires in roughly 93 percent of years on a strategy with a real edge. Run the same function with a 50 percent win rate, a strategy with no edge at all, and you get about 0.986; at a 60 percent win rate it is still about 0.79. Five straight losses barely distinguish a good strategy from a useless one, so the proposed rule mostly cuts capital at random. The likelihood ratio between the no-edge strategy and the 55 percent one, given that a five-loss run occurred, is about 1.06, which is the quantitative way to say the same thing.
Follow-ups worth rehearsing on this prompt:
- A longer trigger. Eight straight losses happen in about 20 percent of years at 55 percent and about 38 percent at 50 percent; ten straight losses, about 4 percent against 11 percent. Longer triggers fire less on a working strategy and separate the two cases better, but they also react later.
- Dependence. Real daily outcomes cluster. If a loss makes the next loss more likely, model the days as a two-state Markov chain and the streak probability rises, most visibly for the longer triggers, so the independent answer understates how often the rule fires.
- Size against count. Five small losses can be harmless. A limit on drawdown of cumulative PnL measures what the risk manager actually cares about, which links this puzzle back to the drawdown code earlier on this page.
- Many strategies. Across twenty independent strategies like this one, nearly all of them will hit a five-loss run in a given year, so a rule applied at portfolio scale needs a different threshold.
A three-week plan from PnL arrays to the finance round
Week one is code. Work through the Squarepoint PnL, drawdown and trade-profit coding set, then the Squarepoint counting, recurrence and greedy coding set. For each problem, write your clarifying questions before the code, say the invariant aloud and finish with the edge cases listed above. Rework the trading problems with a fee and with a cap on trades. Time yourself, since in one report the coding items shared a sitting with short theory questions.
Week two is probability and returns. Do the Squarepoint uniform-draw and card-game probability puzzles on paper, check each with a short simulation, then change one parameter and solve it again. Move on to the Squarepoint Sharpe, bond and derivatives questions with a finance primer open beside you: bonds, equity, dividends, yields, the common derivatives, and the arithmetic of returns (simple against log returns, compounding, annualizing a volatility).
Week three is regression and rehearsal. Do the Squarepoint regression, beta and strategy questions, then generate two synthetic return series with a known beta and confirm that your own code recovers it. Spend two sessions on assessment-style drills: ten-minute blocks with a probability item, a statistics item, a code snippet whose complexity you state, and a scenario where you name the bias (selection, survivorship, look-ahead, confirmation). Finish with a mock that mixes one coding problem with three probability or finance questions, and ask your partner to keep pushing follow-ups.
With only two weeks, merge the second and third weeks and keep the simulation checks, because they are the fastest way to catch a wrong integral.
Where answers on returns and probability slip
- Coding before agreeing on conventions. A drawdown function that returns a positive number, the wrong start index or nothing at all for a rising series is wrong even when its logic is sound.
- Treating prices, returns and cumulative PnL as interchangeable. Beta from prices, Sharpe from cumulative PnL and drawdown from daily changes all produce numbers, and every one of them is wrong.
- Quiet inconsistencies in statistics: sample variance in one place and population variance in another, or dates that do not line up between an asset and its benchmark.
- Integrating before drawing. Most geometric probability errors come from the wrong region or the wrong coordinates, and a sketch catches both.
- Assuming uniformity carries over from a point to anything computed from it.
- Reciting finance definitions with no example, which leaves nothing to say when a follow-up asks for a number.
- Listing regression assumptions without saying how you would check each one or what breaks when it fails.
- Brute-forcing the counting problems. A cubic loop over triplets or a move-by-move simulation handles a small example and fails the follow-up on size.
- Preparing from remembered prompts. One candidate found that their questions matched earlier accounts in format and little else.
- Going quiet while coding. One candidate's coding interviewer gave hints freely, and a hint only helps if you have been talking through your plan.