Apply & Screen
Math/CS/olympiad/research signal on resume; fast online math or coding OA (Optiver/Citadel/Two Sigma style).
Quant & Hedge Funds / 2026-2027 Recruiting Cycle
Two Sigma blends rigorous statistical research with large-scale distributed engineering. Interviewers test whether you can separate genuine predictive alpha from data-mined noise, design leak-free cross-validation pipelines, and scale computations cleanly across massive datasets.
Math/CS/olympiad/research signal on resume; fast online math or coding OA (Optiver/Citadel/Two Sigma style).
45-min live expected value, Bayes, optimal stopping, or systems coding drill with step-by-step mental math.
Live two-sided quoting, order-book mechanics, adverse selection skewing, or low-latency C++/Python debugging.
4–5 rounds across desk traders & researchers testing probabilistic calibration under changing rules.
Isolated textbook probability riddles
HackerRank/code screen + research modeling, stats, and systems loop focused on adverse-selection spreads, Kelly sizing, and real-time EV updates
Under the null (true SR = 0), annualized sample Sharpe has standard error SE ≈ 1 / sqrt(Y) = 1 / sqrt(4) = 0.50 (since daily SR SE is 1/sqrt(T) and annualization multiplies by sqrt(252)). The expected maximum of M = 100 i.i.d. standard normals is E[max Z_i] ≈ sqrt(2 * ln(100)) ≈ 2.51 (exact 2.508). Thus the best pure-noise signal achieves an expected annualized Sharpe of 0.50 * 2.51 ≈ 1.25. Control via Deflated Sharpe Ratio (adjusting for M effective independent trials, skewness, and kurtosis), Benjamini-Hochberg FDR, pre-registered hypotheses, and untouched out-of-sample holdout periods.
Priors: P(2H) = 1/3, P(Fair) = 2/3. Likelihoods: P(HHH | 2H) = 1 and P(HHH | Fair) = (1/2)^3 = 1/8. Total probability P(HHH) = (1/3) * 1 + (2/3) * (1/8) = 1/3 + 1/12 = 5/12. By Bayes' theorem, P(2H | HHH) = (1/3) / (5/12) = 4/5 (80%) and P(Fair | HHH) = 1/5 (20%). Predictive probability of Heads on flip 4 is P(H_4 | HHH) = 0.80 * 1 + 0.20 * 0.50 = 0.90 (90%).
Three i.i.d. violations corrupt naive validation: (1) Cross-sectional correlation across stocks on the same day makes pooled OLS treat 3,000 correlated observations as independent, inflating t-stats by an order of magnitude (fix: Fama-MacBeth daily cross-sectional regressions with Newey-West HAC standard errors on the time series of slopes); (2) Autocorrelated features and overlapping return labels leak future information across adjacent dates in random k-fold splits (fix: walk-forward or Purged K-Fold CV with purge + embargo gaps >= label horizon); (3) Global normalization leaks future mean/std and survivorship drops delisted stocks (fix: strict point-in-time universe and in-fold transforms).
Write SVD X = U * D * V^T. Ridge solves beta_ridge = (X^T X + lambda * I)^(-1) X^T y, shrinking the j-th principal direction by factor d_j^2 / (d_j^2 + lambda). High-variance signal directions (large d_j) pass largely untouched while noisy collinear directions (small d_j) are damped smoothly, sharing weight evenly across correlated signals. Lasso enforces sparse feature selection via soft-thresholding, but in low-SNR financial data it arbitrarily selects one feature from a collinear cluster and zeros the rest, causing unstable out-of-sample weights. Elastic Net (lambda_1 ||beta||_1 + lambda_2 ||beta||_2^2) prunes pure noise while preserving grouping stability among correlated alphas.
Weak (covariance) stationarity requires |phi| < 1. Taking variances of both sides under constant variance gives Var(X) = phi^2 * Var(X) + sigma^2 => Var(X) = sigma^2 / (1 - phi^2). Iterating X_t = phi^k * X_{t-k} + noise gives lag-k autocorrelation rho(k) = phi^k for k >= 0. For 0 < phi < 1, the half-life h satisfies phi^h = 1/2 => h = -ln(2) / ln(phi). For example, phi = 0.95 implies h ≈ 0.693 / 0.0513 ≈ 13.5 periods.
Represent each feature as a dense float32 `[T x N]` matrix (~2,500 x 5,000 x 4 bytes = 50 MB per feature), loaded from columnar Parquet. Split operations cleanly by axis: (1) Rolling 60-day time-series z-scores run independently per asset in O(T * N) using sliding running sum/sum-of-squares (or Welford for numerical stability), parallelized across asset blocks in column-major layout for cache locality; (2) Cross-sectional ranks run independently per date in O(T * N log N), parallelized across dates in row-major layout while masking missing/halted stocks (`NaN`-aware denominators). Strictly align features at close t against returns over (t, t + 1] with zero future-index slicing.
Scale both strategies to unit volatility (mu_1 = 1.5, mu_2 = 1.0). Optimal weights satisfy w proportional to Sigma^(-1) * mu. For rho = 0: w proportional to [1.5, 1.0] (60% / 40% risk split) and combined Sharpe = sqrt(1.5^2 + 1.0^2) = sqrt(3.25) = 1.803. For rho = 0.5: w proportional to [SR_1 - rho * SR_2, SR_2 - rho * SR_1] = [1.5 - 0.5, 1.0 - 0.75] = [1.0, 0.25] (80% / 20% risk split). Combined Sharpe = sqrt((SR_1^2 + SR_2^2 - 2 * rho * SR_1 * SR_2) / (1 - rho^2)) = sqrt((2.25 + 1.0 - 1.5) / 0.75) = sqrt(7/3) = 1.528. Positive correlation severely diminishes diversification uplift.
Detailed balance requires pi_L * P(L -> H) = pi_H * P(H -> L), so 0.02 * pi_L = 0.08 * pi_H => pi_L = 4 * pi_H. With pi_L + pi_H = 1, stationary probabilities are pi_L = 0.80 and pi_H = 0.20. Regime durations are geometric: E[T_L] = 1/0.02 = 50 days and E[T_H] = 1/0.08 = 12.5 days. Two-day return probability: P(L -> L in 2 days) = P(L -> L)^2 + P(L -> H) * P(H -> L) = 0.98^2 + 0.02 * 0.08 = 0.9604 + 0.0016 = 0.9620 (96.20%).
The naive law assumes uncorrelated bets, unconstrained implementation, and zero transaction costs. In practice: (1) Effective breadth BR_eff is much smaller than N * trades/year because cross-sectional factor exposure and serial autocorrelation of slow signals make bets correlated; (2) Real-world constraints (dollar/beta/sector neutrality, short-borrow caps, turnover bands) introduce a Transfer Coefficient TC < 1, yielding IR = TC * IC * sqrt(BR_eff); (3) Nonlinear market impact degrades realized IC as AUM scales, capping net IR even when gross signal IC is stable.
By the order-statistic property of homogeneous Poisson processes, conditional on N(T) = 1, the single arrival time is Uniform(0, T) = Uniform(0, 2), with expected arrival time T/2 = 1.0 second. For an interval of length t = 0.5 seconds, expected arrivals mu = lambda * t = 4 * 0.5 = 2. Using Poisson(2): P(N >= 2) = 1 - P(0) - P(1) = 1 - e^(-2) - 2 * e^(-2) = 1 - 3 * e^(-2) ≈ 1 - 3 * 0.1353 = 0.5940 (59.4%).
After `fork()`, Linux shares physical pages via Copy-on-Write (CoW) until written. However, CPython stores reference counts (`ob_refcnt`) inline inside every Python object header. Merely reading objects or iterating Python containers in worker processes increments/decrements `ob_refcnt` and triggers GC headers, dirtying memory pages and forcing the OS to copy the 8 GB dataset separately into each worker. Fix: place raw numeric arrays in `multiprocessing.shared_memory.SharedMemory`, read-only `numpy.memmap`, or zero-copy Apache Arrow buffers (no per-element Python refcounts), or run multithreaded C++/Numba/Polars kernels that release the GIL.
Project `alpha` orthogonally to the column space of `B` under the inverse-variance metric D^(-1) via weighted least squares: `alpha_neutral = alpha - B * (B^T * D^(-1) * B)^(-1) * B^T * D^(-1) * alpha`. Verification: left-multiplying by `B^T * D^(-1)` yields zero factor exposure (`B^T * D^(-1) * alpha_neutral = 0`), which ensures the minimum-variance portfolio `w proportional to D^(-1) * alpha_neutral` has exact zero exposure (`B^T * w = 0`) to every risk factor in B.
Let N be the number of additional draws needed to beat X_1. The event {N >= k} occurs iff X_1 is the maximum among the k i.i.d. continuous draws {X_1, ..., X_k}. By symmetry (all k orderings of the max are equally likely), P(N >= k) = 1/k for every k >= 1. Using the tail-sum identity for non-negative integers: E[N] = sum_{k=1}^infinity P(N >= k) = sum_{k=1}^infinity (1/k) = +infinity. Even though you beat X_1 almost surely (P(N < infinity) = 1), the heavy tail of extreme initial draws makes the expected waiting time diverge harmonically.
Minimizing E[cost] + lambda * Var(cost) yields inventory trajectory x(t) = X * sinh(kappa * (T - t)) / sinh(kappa * T), where urgency rate kappa = sqrt(lambda * sigma^2 / eta). Permanent impact cost 0.5 * gamma * X^2 is path-independent. As lambda -> 0 (risk-neutral), kappa -> 0 and x(t) -> X * (1 - t/T), recovering uniform TWAP because constant velocity minimizes quadratic temporary impact integral eta * v^2 dt. As lambda -> infinity, kappa -> infinity, front-loading sales near t = 0 to cut inventory variance at the cost of higher temporary impact.
An exact dual-heap (max-heap for lower half, min-heap for upper half) supports O(log n) insert and O(1) median query, but stores every sample—requiring ~8 GB RAM for 1B float64s and failing to support arbitrary p99.9 queries without resizing heaps. Streaming sketches use O(1) bounded memory (~few KB) and are mergeable across distributed nodes: t-digest clusters extreme tails tightly (high accuracy at p99.9 where errors matter most), while DDSketch provides strict relative-error guarantees (e.g., within 1% of true latency) across positive values using logarithmic buckets.
Demonstrate scientific rigor and opportunity-cost awareness: (1) State the economic intuition and falsifiable acceptance criteria defined upfront; (2) Present the exact out-of-sample diagnostic (e.g., alpha collapsed after neutralizing momentum or adding realistic spread costs); (3) Explain why you killed the line of work cleanly rather than p-hacking parameters, and highlight one reusable artifact (cleaned dataset, feature diagnostic, or negative result doc) that saved the team future effort.
Enter the license key emailed after checkout to unlock all 26 firm banks and unlimited timed scoring in this browser.