← DRW Interview Insights

DRW·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

DRW data science interview had a pretty technical stats focus. The question I got was about rolling window standard deviation and the math behind it, which sounds straightforward until you're actually on the spot explaining Bessel's correction to someone who clearly knows the answer already.

Questions Asked (1)

Q1

How do population and sample standard deviation differ in the context of a finite rolling window? Walk through why the denominators are n versus n-1, how that choice changes rolling estimates, what you return when the window has only one element, which version you'd implement by default, and how you'd make it configurable and document it properly.

Technical Trade-offsData ModelingA/B Testing & Experimentation
Author's notes

This one had more layers than I expected.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying that population standard deviation uses n and treats the window as the entire population, while sample standard deviation uses n-1 to correct bias when the window is a sample from a larger process. Then explain the practical implications for rolling estimates, edge cases, and implementation choices, emphasizing configurability and documentation.

Pro tip: In trading contexts, the choice between n and n-1 is often less important than consistency and clear documentation; however, for small windows (e.g., <30), the difference can materially affect volatility estimates, so default to sample (n-1) unless the window is explicitly the full population.

1. Define the statistical difference

Explain that population standard deviation divides by n (the number of observations) and assumes the window contains all possible values, while sample standard deviation divides by n-1 (Bessel's correction) to produce an unbiased estimator when the window is a sample from a larger population.

2. Discuss impact on rolling estimates

Describe how using n vs n-1 affects the magnitude of rolling volatility, especially for small windows; n-1 yields slightly larger estimates, which can matter for risk calculations and signal generation.

3. Handle edge cases

State that for a window of size 1, population standard deviation is 0 (since the single value is the mean), while sample standard deviation is undefined (division by zero); decide whether to return NaN, 0, or raise an error based on context.

4. Choose a default and make it configurable

Recommend defaulting to sample standard deviation (n-1) for general use, but allow a parameter (e.g., ddof) to switch to population; ensure the implementation supports both and that the choice is explicit.

5. Document clearly

Document the parameter, its default, and the implications (e.g., bias, edge cases) in docstrings and user-facing documentation, including examples for small windows.

Key Points to Mention

  • Bessel's correction and unbiased estimation
  • Effect of window size on the difference between n and n-1
  • Edge case: window size 1 (population std = 0, sample std undefined)
  • Default choice: sample standard deviation (ddof=1) for general use
  • Configurability via a parameter like ddof (delta degrees of freedom)
  • Documentation of assumptions, edge cases, and parameter behavior

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.