Data Scientist interview prep
A spaced-repetition deck of 283+ Data Scientist interview questions — organised by topic and difficulty, and scheduled for review based on your ratings. Preview a few cards below, then choose access to study the whole track on an Anki-style SM-2 schedule.
Eligible new monthly or yearly subscribers get 7 days free. Checkout confirms eligibility and charges.
Before you start
Start with Python, basic probability/statistics, and linear algebra. Model and evaluation cards assume experience fitting at least a simple model; they complement experiments.
First pass: Python → Python for Analysts (pandas & matplotlib). Begin with the foundational questions in these modules, then follow the outline. Revisit advanced and senior questions as the job requires; all cards remain available from the start.
Shared topics can appear in several tracks and keep one review history. The outline labels shared foundations and role-specific modules; choose your depth for the job you are preparing for.
What's covered
Every topic in this track, grouped the way you'd study it.
Python
122 cardsShared foundations
Python for Analysts (pandas & matplotlib)
10 cardsShared foundations
Statistics & Probability
11 cardsShared foundations
A/B Testing & Experimentation
9 cardsShared foundations
SQL for Analytics
11 cardsShared foundations
ML Fundamentals & Validation
10 cardsRole-specific module
Classical ML & Ensembles
12 cardsRole-specific module
Metrics & Class Imbalance
11 cardsRole-specific module
Features, Data Prep & Leakage
10 cardsRole-specific module
Deep Learning
12 cardsRole-specific module
NLP & LLMs
12 cardsRole-specific module
ML System Design
8 cardsRole-specific module
MLOps & Production
10 cardsRole-specific module
Behavioral
35 cardsShared foundations
Sample questions
A few cards from the deck — reveal each answer, then choose access to study the full set on a schedule.
What's the difference between mutable and immutable types?
What's the difference between mutable and immutable types?
Short answer: Mutable objects can change in place (list, dict, set); immutable objects cannot (int, str, tuple). Rebinding a variable is different from mutating its object.
items = [1, 2]
alias = items
items.append(3)
assert alias is items and alias == [1, 2, 3]
text = "hello"
original = text
text += " world"
assert original == "hello" # the original string did not change
In depth:
id()identifies an object and stays constant during its lifetime. Treating it as a memory address is a CPython implementation detail.- A tuple cannot replace its elements, but a list stored inside it can still change. Immutability is not automatically deep immutability or thread safety.
- Dictionary keys and set elements must be hashable: their hash stays stable, and equal objects have equal hashes. A tuple containing a list is unhashable. A user-defined mutable instance can be hashable by identity, so hashability is not synonymous with immutability.
- Functions receive references to objects. Mutating an argument can affect the caller; rebinding a local parameter does not rebind the caller's variable.
Sources: Python hashability, object identity.
How does a Series differ from a DataFrame, and how do you load and quickly inspect data?
How does a Series differ from a DataFrame, and how do you load and quickly inspect data?
Short answer: A Series is a one-dimensional labelled array (a single column); a DataFrame is a two-dimensional table of column-Series sharing a row index. You load data with pd.read_csv() / pd.read_sql() and inspect it with .head(), .info(), .describe(), .dtypes, .shape.
In depth:
- Series vs DataFrame —
df['col']returns aSeries;df[['col']](double brackets) returns a one-columnDataFrame. Both carry an.index. - Loading —
read_csv(file/URL),read_sql(a SQL query plus a connection),read_parquet(fast columnar format). - Inspecting —
.head()/.tail()peek at the edges,.info()shows dtypes and null counts,.describe()gives stats on numeric columns,.dtypeslists types,.shapegives size.
import pandas as pd
df = pd.read_csv("sales.csv", parse_dates=["order_date"])
df.shape # (10000, 8) — rows, columns
df.info() # column dtypes and non-null counts
df.describe() # count/mean/std/min/quartiles/max for numerics
df["revenue"].head() # Series — a single column
⚠️ Common mistake: forgetting parse_dates= on load — the date column stays object (a string), so date arithmetic and resample() won't work.
How do mean, median, and mode differ, and why is the median better for skewed data (income, latency)?
How do mean, median, and mode differ, and why is the median better for skewed data (income, latency)?
Short answer: The mean is the sum divided by the count and is sensitive to outliers. The median is the middle value of the ordered data and is robust to outliers. The mode is the most frequent value. For skewed data the median better reflects the "typical" observation.
In depth:
- Mean — good for symmetric data and downstream math (variance, regression), but a single outlier shifts it.
- Median — the 50th percentile; splits the data in half and barely reacts to extremes.
- Mode — the only one of the three that works for categorical data ("most common plan").
| Metric | When to use | Outlier sensitivity |
|---|---|---|
| Mean | symmetric data, downstream calculations | high |
| Median | skewed data: income, latency, prices | low |
| Mode | categorical data, most frequent value | low |
⚠️ Common mistake: reporting the mean for income or latency. A long right tail drags the mean upward, so it no longer describes the typical user — use the median.
How does an A/B test work end to end? Walk through the key steps.
How does an A/B test work end to end? Walk through the key steps.
Short answer: An A/B test is a randomized experiment: users are split at random into control and treatment, shown different versions, and compared on a single pre-chosen primary metric under a fixed decision rule.
In depth:
- Hypothesis — what you change, which metric it should move, and why.
- Metric and MDE — one primary metric plus a minimum detectable effect (MDE).
- Randomization — a random, stable split into control/treatment.
- Sample size and duration — compute and fix them before launch.
- Run to N — run until the sample is reached, without peeking at interim results.
- Analysis — compare the metric, compute the p-value and the confidence interval of the lift.
- Decision — ship or roll back per the pre-defined rule.
Hypothesis → Randomize → Run to N → Analyze → Decision
│ │
control / treatment ship ✓ / rollback ✗
⚠️ Common mistake: changing the UI mid-test or stopping the moment it first looks 'significant' — both break the conclusions.
What are window functions and how do they differ from GROUP BY?
What are window functions and how do they differ from GROUP BY?
Short answer: A window function computes an aggregate over a "window" of rows but does not collapse them — every source row survives and gets its own value. GROUP BY instead folds each group into a single row.
In depth:
- GROUP BY — N rows in a group → 1 result row. Detail is lost.
- Window function — N rows stay N rows, with an aggregate (sum, rank, average, lag) added alongside.
- Syntax —
func() OVER (PARTITION BY ... ORDER BY ...).PARTITION BYdefines the groups,ORDER BYsets order within the window (needed for running totals and ranks).
-- Running total of sales per user
SELECT
user_id,
order_date,
amount,
SUM(amount) OVER (
PARTITION BY user_id
ORDER BY order_date
) AS running_total
FROM orders;
⚠️ Common mistake: trying to filter on a window function's result in WHERE — windows are evaluated after WHERE/GROUP BY, so wrap the query in a CTE/subquery and filter on the outside.
What is overfitting, how do you detect it, and how do you prevent it?
What is overfitting, how do you detect it, and how do you prevent it?
Short answer: Overfitting means the model learned the noise of the training set instead of the pattern: low error on train, high error on new data. You detect it via the train/validation gap and fix it with regularization, a simpler model, early stopping, and more data.
In depth:
- Detection — compare train vs validation error; learning curves: train error keeps falling while validation error stalls or rises → the model started memorizing noise.
- Treatment — reduce capacity or add signal, don't just chase the metric.
| Detect | Fix | |
|---|---|---|
| Metric gap | train ≈ 0, validation clearly worse | regularization (L1/L2), simpler model |
| Learning curves | curves diverge as training goes on | early stopping |
| Cross-validation | unstable metrics across folds | more data, augmentation |
| Model complexity | deep trees, millions of weights | limit depth, prune features |
⚠️ Common mistake: saying "cross-validation prevents overfitting." CV only detects it — it gives an honest quality estimate. Prevention comes from regularization, simpler models, and data.
Ready to make it stick?
Explore a sample, choose a track, and build a review routine that fits your preparation.
Questions about this track
How should I prepare for a Data Scientist interview?
Study the concepts you'll be asked to explain, not just the ones you can code. RecallDeck's Data Scientist track gives you 283+ curated interview questions and resurfaces each one with an Anki-style SM-2 schedule based on your ratings — to practise recalling and explaining them. Combine reviews with coding and mock interviews.
What topics does the Data Scientist track cover?
The Data Scientist track is organised into the core areas Data Scientist interviews actually test, grouped by topic and by difficulty (Concept, Junior, Middle, Senior). You can preview the full outline and sample questions above before signing in.
Is spaced repetition effective for Data Scientist interview prep?
Yes. Active recall and spaced practice can help retain what you study. Grade yourself honestly and check your understanding with practical work. RecallDeck schedules each Data Scientist card using your ratings, so familiar cards return less often and difficult ones get more practice.
Can I try the Data Scientist track before paying?
Eligible new monthly or yearly subscribers can try the complete Data Scientist track and every feature for seven days. Checkout confirms trial eligibility and the amount due; returning subscribers may be charged immediately. Cancel online before the trial ends to avoid its first charge. Lifetime access has no trial.