Published on

Data Science Fundamentals

View .md

 

What a senior data scientist is expected to know cold: statistics, experiment design, causal inference, metric craft, modeling judgment, and evaluation. One section covers the 2026 market, one maps it all onto interview prep.

Table of Contents

  1. Statistical Thinking Under Uncertainty
  2. Experiment Design
  3. Causal Inference Beyond the A/B Test
  4. Metric Design and Decision Framing
  5. Classical ML That Still Wins
  6. Evaluation and Calibration
  7. Bayesian Decision-Making
  8. LLM Evaluation as a Measurement Problem
  9. LLM as a Judge
  10. What Separates a Distinguished Data Scientist from an Average One
  11. What the Market Demands in 2026
  12. Interview Prep for Senior Data Science Roles

1. Statistical Thinking Under Uncertainty

A p-value is the probability of data at least this extreme if the null were true. Not the probability the null is true, not the probability of replication, not an effect size. Most industry damage comes from violating its preconditions, and the biggest violation is peeking:

Same data, same alpha, five times the false ships. The fix is not "never look": either pre-commit the sample size and analyze once, or use methods built for monitoring (sequential tests, or the expected-loss rule in Section 7).

Power is the neglected half. Detecting a lift from 4.2% to 4.4% conversion at 80% power needs roughly 81,000 users per arm. That is the math to run before the test, not the argument to have after a null result.

MistakeWhat it looks likeWhy it is wrong
Peeking / optional stopping"It went significant on day 6, we shipped"Inflates false positives from 5% to ~27% (chart above)
Underpowered test read as "no effect""We tested it, no significant difference"A test powered at 30% misses the true effect 70% of the time
Multiple comparisons20 metrics, one "significant" at p=0.04At alpha 0.05, one in twenty null metrics goes significant by chance
Survivorship in the data pullChurn model trained only on users who completed onboardingThe filter is correlated with the outcome; the sample no longer represents the population
Significance read as importance"p=0.001, huge win"With 10M users, a +0.01% lift is significant and worthless; report the effect size

2. Experiment Design

Running a test is easy; designing it so the answer means something is the craft, and it happens before the first user is assigned.

Three design calls carry most of the weight:

  • Randomization unit. Per-user metrics need per-user randomization; page-view splits show one user both variants and fake the sample size. When users interfere (marketplaces, social), move up to cluster or switchback.
  • SRM. A 50/50 split that lands 50.3/49.7 on 200k users means the assignment is broken, not the product. SRM p < 0.001 invalidates the run, whatever the metrics say.
  • CUPED. Adjusting with each user's pre-experiment value cuts variance by the squared pre/during correlation: at 0.6, a 36% smaller sample. The cheapest speedup in experimentation.
PitfallSymptomFix
SRMSplit is 50.3/49.7 with p < 0.001Audit assignment plumbing; invalidate the run
Novelty effectBig lift week 1, decays to zero by week 3Run at least two full weeks; check the effect by cohort day
InterferenceMarketplace test where control keeps "losing" inventoryCluster or switchback randomization
Metric dilutionFeature only 5% of users see, tested on 100% of trafficTrigger analysis: measure only exposed users, power accordingly
Weekday seasonalityTest started Friday, read MondayAlways run whole weeks (multiples of 7 days)
Winner's curseShipped effects consistently smaller than test effectsShrink estimates; validate with a long-term holdback

The long-term holdback: keep 1 to 5% of users on the old experience for a quarter. It is the only real measure of cumulative shipped impact, and it catches slow harms (ad load, notification fatigue) that two-week tests cannot see.

3. Causal Inference Beyond the A/B Test

Most decisions worth real money cannot be randomized: prices in regulated markets, TV campaigns, policies that leak across users, things already shipped. Each rung of the ladder below buys applicability by paying with a stronger assumption.

MethodIdentifying assumptionBreaks whenProduction example
Randomized experimentRandomization worked (check SRM)Interference between unitsEverywhere
SwitchbackEffects do not carry over between time windowsLong carryover (learning, inventory depletion)Uber and DoorDash pricing and dispatch
Difference-in-differencesTreated and control groups would have moved in parallelA shock hits one group only (check pre-trends)Netflix cites it in production causal surveys
Synthetic controlA weighted blend of donor units reproduces the treated unit's pre-historyToo few donors; the treatment leaks into donorsCity or country launches, TV campaigns
Propensity methods / IPWAll confounders are measuredSelection on unobservables, extreme weightsNetflix inverse probability weighting survey
Double machine learningSame, but flexible ML absorbs high-dimensional confoundersThe same hidden-confounding failure, now harder to seeNetflix Causal Models library, EconML at scale
Uplift / HTE modelsIgnorability plus enough data per segmentSegments too thin; effects confused with correlationsTargeting: who to send the promo to

Diff-in-diff in one example. A region gets a feature at week 10 and revenue climbs 10 by week 20. The control region climbed 7 on trend and a market shock alone, so the true effect is +3. Everything rests on parallel trends: plot the pre-period, run a placebo test at an earlier fake launch date, confirm nothing else hit one group only.

Double ML handles hundreds of confounders: boosted models predict both outcome and treatment, the effect comes from the residuals, cross-fitting keeps overfitting out of the estimate. Its per-segment output is uplift modeling's input, and that is where the money is: promos to users who would convert anyway are pure margin loss.

4. Metric Design and Decision Framing

Choosing the metric is the highest-leverage decision in the pipeline, and turning "make the product better" into a number that resists gaming is a technical act.

Every driver metric is a proxy, and every proxy obeys Goodhart's law. The standing question for any proposed metric: what is the cheapest degenerate way to move this number? Some team will eventually find it.

Anti-patternReal-shaped exampleWhat went wrong
Goodharted proxyOptimize "notifications clicked," ship more notifications, churn risesThe proxy diverged from the outcome it proxied
Ratio metric trapRevenue per session "improves" because low-intent sessions disappearedBoth numerator and denominator moved; per-user totals fell
Averages hiding skewMean revenue per user up 4%, driven entirely by 12 whale accountsReport medians and quantiles alongside means
Dashboard metric nobody can move"Brand health index" reviewed monthly, no team owns itA metric with no causal lever and no owner is decoration
Unpowered guardrail"Churn guardrail passed" on a test that could only detect a 30% churn jumpState the detectable effect size for guardrails too

Decision framing: a p-value does not carry a decision, a cost does. The version that works in a leadership meeting is "+0.8% revenue, 95% interval +0.2 to +1.4; at our volume that is 2.1Mto2.1M to 14.6M a year; the downside still clears the engineering cost, so ship."

5. Classical ML That Still Wins

For tabular business data the winning tool has not changed: gradient-boosted trees (Grinsztajn et al., NeurIPS 2022). TabPFN v2 changed the small-data picture, but the production default remains LightGBM or XGBoost: no GPU, minutes to train, native missing values, monotonic constraints when compliance asks.

SituationDefault
Tabular, 10k to 100M rowsGradient boosting (LightGBM, XGBoost, CatBoost)
Tabular, under ~10k rowsTabPFN or regularized linear models
Need coefficients a regulator can readLogistic regression, monotonic GBM
Text, images, audioPretrained deep models, fine-tuned
Any of the above, day 1A baseline first: mean, last value, or logistic regression

The baseline tells you how much signal exists, catches broken pipelines, and gives every later improvement a denominator.

Leakage always flatters you. The most expensive ML failure is not a weak model but a strong-looking one, because information from outside the prediction window snuck into training.

Leakage typeExampleDetection
Target leakage"Days since cancellation call" as a churn featureFeature importance dominated by one suspiciously good feature
Temporal leakageRandom train/test split on time-ordered dataPerformance collapses when you switch to a time-based split
Preprocessing leakageScaler or encoder fit on the full dataset before splittingFit all preprocessing inside the cross-validation loop
Join leakageFeature table snapshotted today, joined onto last year's training rowsPoint-in-time joins; this is what feature stores enforce

Two habits close most of these: preprocessing lives inside the pipeline so it refits per fold, and time-ordered data always gets time-based splits. If the time-split score is much worse than the random-split score, you found the leak. Feature engineering lives in the pandas walkthrough; infrastructure in the ML prep guide and MLOps write-up.

6. Evaluation and Calibration

Accuracy is not a business quantity; every threshold is a decision with asymmetric costs.

  • Thresholds are expected-value choices. A 5falsepositivereviewagainsta5 false-positive review against a 100 false-negative chargeback puts the optimal threshold near 0.05, not 0.5. Two models with equal AUC can differ by millions at the operating threshold. Getting the two costs from finance is data science work.
  • Calibration is whether 0.7 means 70%. Boosted trees and neural nets are routinely miscalibrated; anything doing arithmetic on scores (expected LTV, cost ranking) inherits the error. Check with a calibration curve, fix with isotonic regression (large data) or Platt scaling (small).

Offline gains shrink online: the world reacts to models, pipelines differ between training and serving, populations drift. Monitor inputs, not just outputs; labels arrive late or never, but feature drift shows in real time. A population stability index on the top features catches most silent failures.

7. Bayesian Decision-Making

Netflix runs Bayesian A/B testing in production, and the reason to care is that the Bayesian readout answers what the room is actually asking:

The room asksFrequentist readoutBayesian readout
"Which one is better?""p = 0.037, reject the null""98% probability B beats A"
"How wrong could we be?"A confidence interval, routinely misread"If B is actually worse, expected loss is under 0.001pp"
"Can we check it daily?"No; peeking inflates false positivesYes; the expected-loss rule is built for monitoring
"We only have 8,000 users"Wide intervals, swingy point estimatesA mild prior (last quarter's rate) regularizes the noise

The machinery for conversion metrics is a Beta prior per arm, updated by observed conversions; simulate both posteriors and read off the win probability and the expected loss of shipping the loser. On 100k users per arm at 4.12% vs 4.31%, that is ~98% probability B wins, expected loss ~0.0006pp.

  • Ship on expected loss, not p-value. You are capping regret, not controlling false positives, so checking daily is the intended use.
  • State the prior. An unstated prior is the Bayesian version of peeking.
  • Feed the posterior to the decision. Simulate revenue per posterior draw; report the distribution, not a point estimate.

One caveat: platform-scale experimentation still runs frequentist sequential methods because they industrialize better. Bayesian framing wins for bespoke analyses, low traffic, and rooms that act on the number.

8. LLM Evaluation as a Measurement Problem

The GenAI wave did not retire these fundamentals; it made them the bottleneck. MIT's NANDA study found 95% of enterprise GenAI pilots delivered no measurable P&L impact. The models work; the measurement does not.

Classical conceptLLM-era equivalent
Test setGolden set: 50 to 500 curated cases with reference answers
LabelingLLM-as-judge, periodically audited against human labels
Measurement errorJudge bias: position, verbosity, self-preference
Guardrail metricsRefusal rate, latency, cost per interaction, safety flags
Online experimentA/B test on task completion, not on "sounds better"
CalibrationDoes a judge score of 8/10 map to a stable pass rate?

The toolkit transfers intact: power analysis sizes the golden set, SRM-style checks catch broken eval pipelines, the Section 7 shipping rule applies to "prompt v2 beats prompt v1." For agents, guardrails (tool-call errors, cost per task, escalations) matter more than the headline score. The production side is in The AI Engineer's Swiss Knife and Graph Engineering for Agentic AI.

9. LLM as a Judge

The judge is a measurement instrument with documented biases (Zheng et al., MT-Bench); using it without controls is the GenAI version of peeking.

BiasWhat happensMitigation
Position biasThe answer shown first wins more oftenJudge every pair twice with positions swapped; only verdicts that survive both orders count
Verbosity biasLonger answers win regardless of qualityInstruct the judge to score rubric fit only; spot-check length-vs-score correlation
Self-preferenceModels rate their own outputs higherJudge with a different model family than the one being evaluated
  • Pairwise beats pointwise: comparisons are anchored by the alternative; absolute 1-to-10 scores drift.
  • A flipped verdict is a tie: counting positional noise for either side manufactures signal.
  • Cheap judge, expensive audit: an unaudited judge is an unvalidated instrument.
  • The rubric is the instrument definition: version it, and treat rubric changes like metric changes.

10. What Separates a Distinguished Data Scientist from an Average One

The average column is a competent scientist, not a caricature. The gap is where the work starts and stops:

DimensionAverage data scientistDistinguished data scientist
Problem framingAnswers the question as askedAsks what decision this analysis will change; declines work that changes none
MetricsOptimizes the metric handed downInterrogates the metric first; predicts how it will be gamed
StatisticsRuns the test, reports the p-valueDesigns for power up front; catches peeking and SRM in review
Causality"We can't A/B test this, so we can't know"Climbs the methods ladder and states the identifying assumption out loud
ModelingReaches for the newest architectureBaseline first; treats a suspiciously good result as a leak until proven otherwise
EvaluationReports offline AUCPrices the errors, calibrates the scores, trusts nothing until shadow mode
GenAIDemos what the model can doMeasures whether it moved the business number
CommunicationPresents the analysisPresents the decision: recommendation, dollar range, downside case
Failure handlingThe null result dies in a slide deckLogs the learning where the next team will find it; kills own projects early
LeverageTheir output is their own analysesTheir output is the standard: templates, review culture, platforms

Three rows do most of the separating:

  • Decisions, not analyses. Their unit of work is a changed decision; if nobody would act differently on the answer, the project does not start.
  • Assumptions said out loud. Parallel trends, no hidden confounding, the prior, the judge rubric: stated in the first five minutes, with the test that would break them. That is what makes their number the one the room acts on.
  • Leverage over output. Their fingerprints are on work they never touched: the review checklist that catches SRM, the metric definitions everyone reuses, the eval harness that made rigor cheaper than sloppiness.

11. What the Market Demands in 2026

One caveat: posting studies disagree wildly by job board. 365DataScience got Python at 85% (Glassdoor) and 57% (Monster) in the same month, so trust year-over-year deltas within one methodology, not absolute levels. With that filter, the senior demand stack:

RankSkillThe evidence
1Experimentation and causal inferenceCausal inference up 17pp YoY, A/B testing up 14pp, the two largest technical gains (Choo)
2Communication and stakeholder management86% of postings, above SQL and Python; stakeholder mgmt up 13pp (Choo)
3SQL and warehouse-shaped data work79% of postings, up 18pp; ETL up 18pp, Snowflake up 10pp, dbt up 9pp (Choo)
4Python plus core MLPython 57 to 85%, ML 62 to 77% across sources; table stakes, not differentiators
5Metric design and model evaluationCore senior interview dimension at Meta, Google, Netflix, Airbnb
6GenAI measurement literacy (evals, LLM-as-judge)~60% of postings expect "some AI capability" (Vourakis); dedicated LLM-evaluation titles appearing
7Cloud and pipelines~62% mention cloud; AWS 20 to 27%, Azure 14 to 29% (365DataScience)
  • Classical causal skills are outgrowing GenAI skills: +17pp and +14pp vs LLM engineering +9pp, agentic AI +8pp, RAG +4pp.
  • AI is signaled everywhere, measurement is hired: 45% of data postings mention AI (Indeed), yet prompt engineering, RAG, and GPT keywords all sit under 5%.
  • The bar is mid-to-senior: 73% of AI-mentioning postings target mid or senior; entry level is under 6% (Vourakis).
  • DS decoupled from the tech recession: tech postings ~34% below peak, DS up ~15% over three years, BLS projects 34% growth to 2034.

12. Interview Prep for Senior Data Science Roles

Senior interviews test judgment, not formulas. Every stage maps onto a section above:

StageWhat it testsThe senior bar
SQL and coding screenFluency, not puzzlesWindow functions, cohort queries, clean joins, narrated as you go
Statistics and probabilityWhether your intuitions survive follow-upsPlain-language p-values and power, then catching the trap in the follow-up (Section 1)
Experimentation caseEnd-to-end design under constraintsMetric, randomization unit, power math, guardrails, SRM, and the no-randomization fallback (Sections 2, 3)
Product and metric caseBusiness sense wearing a technical coatMetric hierarchy, Goodhart failure modes, decomposition when a number moves (Section 4)
ML case / system designJudgment about the boring partsBaseline first, leakage hunting, costed evaluation, monitoring plan (Sections 5, 6)
BehavioralInfluence without authorityThree stories with measured outcomes: a decision changed, a launch stopped, a standard set
The question as askedWhat it actually testsThe strong answer runs through
"Our metric dropped 8% last week. Walk me through it."Structured decomposition under ambiguityThe investigation tree below
"Design an experiment for this feature."Whether you design before you runSection 2, in the lifecycle order
"We can't A/B test this. Now what?"Whether your toolkit ends at randomizationSection 3's ladder, assumption stated
"How would you measure success for product X?"Metric craft and gaming instinctsSection 4: north star, drivers, guardrails
"Explain this result to a non-technical exec."Whether rigor survives translationEffect size, dollar range, downside case; never the p-value alone
"Your model is great offline but flat online. Why?"Leakage and evaluation maturitySections 5 and 6: leakage taxonomy, then the ladder
"Should we ship it?"Decision framing under uncertaintySection 7: expected value or expected loss
"How would you evaluate our new LLM feature?"Whether GenAI enthusiasm comes with measurementSections 8 and 9: golden set, judge protocol, then an A/B

The metric-drop case is the most common one, and the winning structure is a tree, artifact branch first: a double-digit overnight move is a logging change until proven otherwise.

Five signals that read as senior in the room:

  • State assumptions unprompted: "this assumes no interference; here is how I would check."
  • Quantify by default: rough power math, a dollar range, a cost per error type.
  • Drive the scope: ask what decision the analysis serves; underspecified questions are planted.
  • Say "I don't know, and here is how I would find out." Bluffing ends more loops than knowledge gaps do.
  • Bring three stories with measured endings. Senior behavioral rounds are impact audits.

Takeaways

  • The senior toolkit is rigor applied to decisions: statistics that survive peeking and power scrutiny, experiments designed before they run, a causal ladder for what cannot be randomized, metrics built to resist gaming, evaluation priced in the business's currency.
  • Peeking, power, and SRM separate running tests from learning from them: optional stopping turns 5% false positives into ~27%.
  • Say the identifying assumption out loud on every rung of the causal ladder.
  • Metrics are designed objects: north star, drivers, guardrails, and "what is the cheapest degenerate way to move this number."
  • Gradient boosting is the tabular default; leakage always flatters you. Calibrate before doing arithmetic on scores; pick thresholds by expected cost.
  • LLM evaluation is the same fundamentals with a noisy instrument, and the judge becomes trustworthy only under protocol: position swaps, ties for disagreements, human audits, versioned rubrics.
  • The distinguished gap is not technique: decisions over analyses, assumptions out loud, leverage over output.
  • Interviews audit judgment: decompose artifact-first, design before running, quantify unprompted, bring stories with measured endings.

Sources and further reading

Market and hiring data

Methods