RecallDeck
Interview track

Data Scientist interview prep

A spaced-repetition deck of 291+ Data Scientist interview questions — organised by topic and difficulty, and resurfaced right before you'd forget. Preview a few cards below, then sign in to study the whole track on an Anki-style SM-2 schedule.

291 cards17 topics

Free · sign in with GitHub · your progress stays yours.

What's covered

Every topic in this track, grouped the way you'd study it.

ML Fundamentals & Validation

10 cards
ML Fundamentals

Classical ML & Ensembles

12 cards
Classical ML

Metrics & Class Imbalance

11 cards
Metrics

Features, Data Prep & Leakage

10 cards
Features & Leakage

Deep Learning

12 cards
Deep Learning

NLP & LLMs

12 cards
NLP & LLMs

ML System Design

8 cards
ML System Design

MLOps & Production

10 cards
MLOps & Production

Python

130 cards
Core LanguageData Model & InternalsConcurrency & AsyncStdlib, Typing & Testing

SQL for Analytics

11 cards
SQL for Analytics

Statistics & Probability

11 cards
Statistics

A/B Testing & Experimentation

9 cards
Experimentation

Python for Analysts (pandas & matplotlib)

10 cards
Python for Analysts

Behavioral

35 cards
Behavioral

Sample questions

A few cards from the deck — reveal each answer, then sign in to study the full set on a schedule.

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:

  1. Detection — compare train vs validation error; learning curves: train error keeps falling while validation error stalls or rises → the model started memorizing noise.
  2. 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.

How does a decision tree choose splits, and why do deep trees overfit?

Short answer: Greedily: at each node it scans features and thresholds and picks the split with the largest impurity reduction (Gini or entropy; MSE for regression). With unlimited depth the tree drives leaves to purity — i.e. it memorizes the training set, noise included.

In depth:

  1. Split criterion — the gain: impurity(parent) − weighted impurity(children); Gini G = 1 − Σpₖ², entropy −Σpₖ·log pₖ — nearly interchangeable in practice.
  2. Greediness — each node is optimized in isolation; the globally optimal tree is NP-hard, so a bad split near the root is never revisited.
  3. Why overfitting — the model is piecewise-constant: with unlimited depth every leaf shrinks to a single sample → zero training error, high variance on test.
Constraint What it does
max_depth caps the number of levels
min_samples_leaf stops leaves shrinking to 1 sample
ccp_alpha (pruning) cuts nodes that don't pay for their complexity
Ensembles RF/boosting turn the tree's weakness into strength

⚠️ Common mistake: believing the tree finds the globally "best partition" — it's greedy, and that's a fundamental limitation, not an implementation detail.

Define precision and recall via the confusion matrix. When does each matter more?

Short answer: Precision = TP/(TP+FP) — the share of true positives among everything the model flagged as positive. Recall = TP/(TP+FN) — the share of actual positives the model found. Recall is critical where a miss is costly (cancer screening, fraud); precision where a false alarm is costly (spam filters, content takedowns).

In depth:

Actual: 1 Actual: 0
Predicted: 1 TP FP
Predicted: 0 FN TN
  1. Precision — read the "predicted: 1" row: how many of the model's alerts are real. The cost-of-false-alarm metric.
  2. Recall — read the "actual: 1" column: what fraction of real positives we caught. The cost-of-a-miss metric.
  3. Trade-off via the threshold — lower the threshold → you catch more positives (recall up) but false alarms grow (precision down). One model is a whole curve of (P, R) pairs, not a single point.

⚠️ Common mistake: reciting the formulas and stopping. A strong answer starts from "which is more expensive — a miss or a false alarm", and only from that decides which metric leads.

Which models need feature scaling and why?

Short answer: Scaling matters for models that rely on distances, dot products, or gradient descent: kNN, SVM, k-means, PCA, regularized linear models, neural nets. Trees, forests, and boosting don't need it — they are invariant to monotone transforms.

In depth:

Model Scaling Why
kNN, k-means, SVM required distances: a feature in meters drowns out one in kilometers
PCA required variance: components chase the feature with the largest scale
Linear + L1/L2 required the weight penalty depends on feature scale
Neural nets needed gradient descent convergence
Trees / RF / boosting not needed threshold splits; value order doesn't change

And the key point: the scaler is part of the model. Fit on train only, transform valid/test — otherwise test statistics leak into training.

⚠️ Common mistake: scaling everything "just in case" before the split — a harmless habit turns into leakage; and conversely, wasting time scaling for XGBoost.

How does dropout work, and what happens to it at inference time?

Short answer: During training, dropout zeroes random activations with probability p: every batch trains its own “thinned” subnetwork, which prevents neuron co-adaptation and acts like an ensemble of subnetworks. At inference dropout is OFF; to keep activation scale consistent, inverted dropout divides by (1−p) already at training time.

In depth:

  1. Mechanics — a binary mask over activations, resampled every forward pass; a neuron cannot rely on specific neighbors and learns more robust features.
  2. Interpretation — training an exponential number of weight-sharing subnetworks; inference ≈ averaging that ensemble.
  3. Inverted dropout — activations are divided by (1−p) during training, so nothing needs rescaling at inference — the layer simply switches off.
  4. Where to put it — usually after fully-connected layers; in convnets it is more often replaced by BatchNorm and augmentations.
drop = nn.Dropout(p=0.3)
model.train()   # mask active, the (1-p) rescaling is built in
model.eval()    # dropout off: deterministic inference

⚠️ Common mistake: forgetting the train/inference difference (and model.eval() in PyTorch): dropout left on at inference produces noisy predictions.

What are embeddings, and what changed from word2vec to contextual embeddings (BERT-style)?

Short answer: An embedding is a dense vector encoding a token's meaning so that semantically similar items sit close in vector space. The key shift: word2vec gives a static vector — one per word, always — while BERT-style models give a contextual one: the vector depends on the sentence, finally solving polysemy.

In depth:

  1. word2vec (skip-gram) — learns to predict context words from a word; after training it is a lookup table "word → vector". "Bank" of a river and "bank" with your money get the same vector.
  2. Contextual embeddings — a word's vector is computed by a transformer over the whole sentence; "bank" gets different vectors in different phrases.
  3. Pretraining objectives differ — skip-gram/CBOW for word2vec vs masked LM for BERT: predict a masked token from bidirectional context.
word2vec BERT-style
Vector one per word (static) context-dependent
Polysemy can't distinguish distinguishes
Pretraining skip-gram / CBOW masked LM
Unit word subword token

⚠️ Common mistake: reciting "king − man + woman ≈ queen" but failing to name the real win of contextual embeddings — solving polysemy.

Ready to make it stick?

Start your first session in under a minute. Your future self, mid-interview, will thank you.

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 291+ curated interview questions and resurfaces each one with an Anki-style SM-2 schedule right before you'd forget it — so the answers are still there under pressure on interview day.

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. Actively recalling an answer and grading yourself honestly builds far more durable memory than re-reading notes. RecallDeck schedules each Data Scientist card to reappear at the moment you're about to forget it, so your daily reviews shrink while your recall holds.

Is the Data Scientist track free?

Yes — the Data Scientist track and the full SM-2 scheduler are free, with 20 new cards a day. Sign in with GitHub and your progress syncs to your account. RecallDeck Pro ($5/month or $29/year) raises the daily budget and adds cram mode.

Other interview tracks

RecallDeckSpaced-repetition interview prep