Data Science
How to Prepare for Data Science Interviews from Scratch
Most people start data science interview preparation by opening a random list of “Top 100 ML questions” and hoping repetition will be enough. It rarely is.

Most people start data science interview preparation by opening a random list of “Top 100 ML questions” and hoping repetition will be enough. It rarely is.
Data science interviews test something more specific: can you reason from raw data and ambiguous business questions to a sound, measurable solution? If you’re starting data science from scratch, you need a roadmap that builds that ability step by step—not just a pile of flashcards.
This guide lays out a practical, end‑to‑end plan for data science interview preparation: what to learn, in what order, and how to practice so you’re ready for real interviews, not just trivia quizzes.
We’ll cover fundamentals, coding, machine learning, analytics, case studies, and system design—all in a structured ml interview roadmap you can follow from zero to on‑site. For a comprehensive overview, see the Data Science Interview Preparation: Complete Roadmap.
1. Understanding the Data Science Interview Landscape
Before you start grinding, you need a clear mental model of what “data science interviews” actually test. Different companies and roles emphasize different skills:
1.1 Common Interview Formats
Most data science and analytics interview processes mix some subset of:
-
Screening / Recruiter call
- Background, motivations, basic fit.
- Occasionally 1–2 high-level ML or analytics questions.
-
Technical phone screen / online assessment
- Coding: SQL and/or Python.
- Probability & statistics: conditional probability, hypothesis testing.
- ML fundamentals (for DS/ML roles): bias–variance, overfitting, metrics.
-
On-site or virtual loop (3–5 interviews)
- Coding / Data manipulation
- SQL: joins, aggregations, window functions.
- Python: data wrangling, simple algorithms, pandas.
- ML / modeling
- Model selection, evaluation, feature engineering.
- Walkthrough of a past project.
- Analytics / product sense
- Experiment design, metrics, interpreting dashboards.
- Case study / take-home
- End‑to‑end reasoning from vague business question to analysis or model.
- Behavioral
- Communication, ownership, working with stakeholders.
- Coding / Data manipulation
1.2 Role Types and Focus
Roughly, you’ll see three common flavors:
-
Analytics / Product Data Scientist
- Heavy SQL, experimentation, metrics, dashboards.
- Emphasis on business impact and clear communication.
-
ML / Core Data Scientist
- Strong ML theory and practice, modeling, evaluation.
- More emphasis on algorithms, feature engineering, production concerns.
-
ML Engineer / Applied Scientist
- Deep software engineering + ML.
- System design, scalability, APIs, and deployment.
Your data science interview preparation should reflect the role you’re targeting, but the foundation is similar: statistics, coding, and reasoning from data.
2. Roadmap Overview: Data Science from Scratch
If you’re starting from scratch, here is a high‑level roadmap:
-
Math & Stats Fundamentals
- Probability, distributions, expectation.
- Hypothesis testing, confidence intervals.
- Linear algebra and calculus basics relevant to ML.
-
Programming & Data Manipulation
- Python (or R, but Python is more common): data structures, functions, OOP basics.
- SQL: joins, aggregations, window functions.
- Pandas / NumPy for data wrangling.
-
Core Machine Learning
- Supervised vs unsupervised learning.
- Linear/logistic regression, trees, ensembles.
- Overfitting, regularization, cross‑validation, metrics.
-
Analytics & Experimentation
- Metric design, funnels, cohort analysis.
- A/B testing, power, sample size.
- Interpreting ambiguous or noisy results.
-
End‑to‑End Problem Solving
- Case studies.
- Project walkthroughs.
- Communication and stakeholder framing.
-
Interview‑Specific Practice
- Mock interviews (technical and behavioral).
- Timed SQL/Python problems.
- Whiteboard / collaborative editor practice.
We’ll now go through each of these with concrete steps and examples.

3. Step 1 – Build the Math & Stats Foundation
You don’t need a PhD in statistics, but you do need to be fluent in the basics. Interviewers care about whether you understand why a method works and when it fails.
3.1 Core Probability and Statistics
Focus on concepts that directly show up in interviews:
-
Probability basics
- Random variables, PMF/PDF, CDF.
- Conditional probability, Bayes’ rule.
- Independence vs correlation.
-
Distributions
- Bernoulli, Binomial, Normal, Poisson, Exponential.
- When each is appropriate (e.g., Poisson for counts over time).
-
Expectation & variance
- Linearity of expectation.
- Variance, standard deviation, covariance.
-
Estimation & inference
- Sampling, central limit theorem (intuitively).
- Confidence intervals: what they actually mean.
- Hypothesis testing: null/alternative, p‑values, type I/II errors.
-
Common interview patterns
- “You flip a biased coin until X happens…”
- “What’s the probability two people share a birthday?”
- “If a test has 95% sensitivity and 90% specificity…”
These often come up in analytics interview prep and ML interviews alike. For a deeper dive into statistics questions commonly asked in data science interviews, check out Statistics Questions Commonly Asked in Data Science Interviews.
Example: Conditional Probability
Question:
A test for a disease is 99% sensitive (true positive) and 95% specific (true negative). The disease prevalence is 1%. If someone tests positive, what’s the probability they actually have the disease?
Let:
- D = has disease, ¬D = no disease
- T+ = test positive
We want: P(D | T+)
Using Bayes’ rule:
[ P(D | T+) = \frac{P(T+ | D) P(D)}{P(T+)} ]
Where:
[ P(T+) = P(T+ | D)P(D) + P(T+ | \neg D)P(\neg D) ]
Given:
- P(T+ | D) = 0.99
- P(T+ | ¬D) = 1 − specificity = 0.05
- P(D) = 0.01, P(¬D) = 0.99
Compute:
[ P(T+) = 0.99 \cdot 0.01 + 0.05 \cdot 0.99 = 0.0099 + 0.0495 = 0.0594 ]
[ P(D | T+) = \frac{0.99 \cdot 0.01}{0.0594} \approx 0.1667 ]
So the probability is ~16.7%, not 99%. This kind of reasoning is common in ML and analytics interviews.
3.2 Linear Algebra & Calculus (Just Enough)
For most interviews:
-
Linear algebra
- Vectors, matrices, matrix multiplication.
- Dot product, norms.
- Conceptual understanding of eigenvalues/eigenvectors and SVD/PCA (no need to derive).
-
Calculus
- Derivatives and gradients conceptually.
- Gradient descent intuition: moving in direction of steepest descent.
Most questions will ask for intuition (e.g., “Why does L2 regularization help?”) rather than symbolic derivations.
4. Step 2 – Programming & Data Manipulation
Even for analytics roles, you’ll write code. For ML roles, coding is central.
4.1 Python Essentials for Data Science
You need to be comfortable writing and reading Python code that manipulates data. Focus on:
- Data types: lists, dicts, sets, tuples.
- Control flow: loops, conditionals, comprehensions.
- Functions, classes (basic OOP).
- File I/O, reading CSV/JSON.
- Libraries: NumPy, pandas, matplotlib/seaborn (for EDA).
Example: Simple Pandas Task
You might get something like:
Given a user events table with columns:
user_id,event_type,timestamp, compute the daily active users (DAU).
PYTHON
You should be able to write and explain something like this under time pressure. For more on Python topics relevant to data science interviews, see Top Python Topics for Data Science Interviews.
4.2 SQL for Data Science Interviews
For many data science and analytics roles, SQL is the single most important coding skill. Common patterns:
- SELECT, WHERE, GROUP BY, HAVING.
- INNER/LEFT/RIGHT/FULL joins.
- Window functions:
ROW_NUMBER(),RANK(),LAG(),LEAD(). - Common Table Expressions (WITH).
- Filtering, subqueries, CASE expressions.
Example: Top N per Group
Problem: For each product category, find the top 3 products by revenue.
SQL
Interviewers care about whether you can translate a business question into SQL, not just syntax memorization.

5. Step 3 – Core Machine Learning Concepts
Once you can code and manipulate data, you’re ready for ML. The goal isn’t to memorize every algorithm, but to deeply understand a small set of core models and patterns.
5.1 Supervised Learning Basics
Focus on:
-
Regression
- Linear regression: assumptions, interpretation of coefficients.
- Regularization: L1 (Lasso), L2 (Ridge), why they help.
-
Classification
- Logistic regression: sigmoid, decision boundary.
- Decision trees: splits, depth, overfitting.
- Ensembles: random forests, gradient boosting (XGBoost/LightGBM).
-
Model evaluation
- Train/validation/test splits, cross‑validation.
- Metrics:
- Regression: MSE, RMSE, MAE, R².
- Classification: accuracy, precision, recall, F1, ROC‑AUC, PR‑AUC.
- Confusion matrix and trade‑offs.
Example: Explaining Overfitting
You might be asked:
What is overfitting and how do you prevent it?
A strong answer:
- Overfitting = model captures noise instead of signal, performs well on training but poorly on unseen data.
- Causes: overly complex model, too many features, too few samples.
- Detection: gap between training and validation performance.
- Mitigation:
- Regularization (L1/L2).
- Simpler model (prune trees, limit depth).
- More data or data augmentation.
- Proper cross‑validation.
- Early stopping for iterative models.
5.2 Feature Engineering and Data Leakage
Interviewers often probe your practical ML experience:
- Handling missing values, outliers.
- Encoding categorical variables (one‑hot, target encoding).
- Scaling features (standardization, normalization).
- Avoiding data leakage: ensuring features don’t contain information from the future or from the label.
Example: Data Leakage Scenario
You’re predicting whether a user will churn in the next 30 days. You include a feature “number of logins in the next 7 days”. What’s wrong?
This feature uses future information relative to the prediction time. In production, you won’t have it when making predictions, so your evaluation is overly optimistic. You must only use features available at prediction time.
5.3 Unsupervised Learning (Light Coverage)
For most interviews:
- Clustering: k‑means, hierarchical clustering (high level).
- Dimensionality reduction: PCA (intuition: projecting data to directions of maximum variance).
Know when you might use them (e.g., customer segmentation, exploratory analysis), but don’t over‑invest unless the role is explicitly focused here.
For a detailed breakdown of machine learning interview questions and concepts, see Top Machine Learning Interview Questions for 2026 (With Concepts Breakdown).
6. Step 4 – Analytics & Experimentation Skills
Even ML‑heavy roles need strong analytical reasoning. For product data science roles, this is core.
6.1 Metrics and Product Thinking
You should be able to:
- Define North Star metrics and supporting metrics.
- Break down metrics into funnels and components.
- Reason about trade‑offs (e.g., engagement vs revenue vs user experience).
Example: Defining a Metric
How would you measure the success of a new recommendation system on an e‑commerce site?
Possible metrics:
- Primary: conversion rate, revenue per session, click‑through rate on recommendations.
- Secondary: time on site, number of items per order.
- Guardrails: bounce rate, complaint rate, long‑term retention.
Show that you can think beyond a single number and anticipate unintended consequences.
6.2 A/B Testing and Experiment Design
Key concepts:
- Randomization, control vs treatment.
- Null and alternative hypotheses.
- Statistical significance (p‑value) vs practical significance (effect size).
- Power, sample size, duration.
- Common pitfalls: peeking, multiple comparisons, seasonality.
Example: A/B Test Question
You run an A/B test and see a 2% lift in conversion, p = 0.03. What do you do?
Strong reasoning includes:
- Check if assumptions hold (randomization, no major external events).
- Examine confidence intervals and effect size; is 2% business‑meaningful?
- Look at guardrail metrics (e.g., refund rate).
- Consider heterogeneity: does the lift hold across segments?
- Decide on rollout plan and monitoring.
7. Step 5 – End‑to‑End Problem Solving & Case Studies
This is where everything comes together: can you take a fuzzy problem and structure it?
7.1 Common Case Study Formats
You might get:
- Analytics case
- “Signups dropped by 10% last week. How do you investigate?”
- ML design case
- “Design a model to rank search results.”
- Take‑home assignment
- Analyze a dataset, produce a notebook and a short write‑up.
7.2 A Structured Approach
A good general framework:
- Clarify the objective
- What is success? What constraints exist?
- Understand the context
- Product, users, current system.
- Plan the approach
- Data needed, metrics, experiments, model types.
- Execute & analyze
- Outline key steps, potential pitfalls.
- Communicate results
- Summarize findings, caveats, and next steps.
Example: Analytics Case Outline
Signups dropped by 10% last week. How do you investigate?
You might structure:
-
Clarify
- Is this global or specific to regions/platforms?
- Is 10% outside normal variance?
-
Segment
- By channel (organic, paid), device, geography, new vs returning users.
-
Funnel analysis
- Page views → clicks → signups.
- Where is the drop concentrated?
-
System & experiment checks
- Any recent releases? A/B tests? Tracking changes?
-
Hypothesis generation & testing
- E.g., broken form on mobile, pricing change, slower page load.
-
Next steps
- Short‑term mitigation, long‑term monitoring.
Interviewers evaluate your structure, not just the final answer.
For examples of impactful End-to-End Data Science Projects That Impress Interviewers, consider building projects that showcase this structured thinking.

8. Step 6 – Interview-Specific Practice Strategy
Once your fundamentals are solid, you need to practice in the format you’ll be evaluated in.
8.1 Coding and SQL Practice
- Use timed environments to simulate pressure.
- Alternate between:
- LeetCode‑style questions for basic algorithmic fluency.
- Data‑centric problems (pandas/SQL on realistic schemas).
Pattern‑based learning helps here: instead of solving 100 random questions, learn recurring patterns (e.g., “group and filter”, “top‑N per group”, “time‑series rolling metrics”). If you’re focusing on DSA as well, a structured sheet like Thita’s DSA for Beginners: What to Study First and in What Order can help you cover breadth efficiently.
8.2 ML and Analytics Question Drills
Create flashcards or a doc for:
- Core ML concepts (overfitting, regularization, bias–variance).
- Common analytics and A/B testing questions.
- Metric design and product sense prompts.
Practice speaking answers out loud. Clarity and structure matter as much as correctness.
8.3 Mock Interviews
Mock interviews are the fastest way to close the gap between knowledge and performance:
- Do both technical (coding, ML) and behavioral mocks.
- Record yourself if possible; review for:
- Rambling vs clear structure.
- Jargon vs accessible explanations.
- How you handle “I don’t know” moments.
An AI mock interviewer (e.g., Thita’s AI Mock Interviews vs Real Interviews: Do They Actually Help? or AI Interview Practice: Free Mock Interview Simulator with Real-Time Feedback for Technical Interviews) can be useful to get high‑frequency reps with feedback, especially when human partners are scarce.
9. Common Mistakes in Data Science Interview Preparation
Avoiding these will save you months.
9.1 Memorizing Without Understanding
- Memorizing “top 100 questions” without grasping the underlying concepts.
- Recognizable when you can recite definitions but fail on simple variations.
Fix: After learning a concept, ask:
- Can I explain this to a non‑technical person?
- Can I derive or justify the formula intuitively?
- Can I give a concrete example where it applies and where it fails?
9.2 Ignoring SQL and Analytics
- Many candidates over‑invest in advanced ML (deep learning, fancy models) and under‑invest in SQL, basic stats, and product sense.
- For most DS roles, that’s backwards.
Fix: Make sure your weekly schedule always includes:
- SQL practice.
- At least one analytics or A/B testing case.
9.3 No Projects or Real Data Experience
- Only having coursework or toy Kaggle notebooks.
- Interviewers want to see that you’ve wrestled with messy, real data and ambiguous goals.
Fix:
- Do 1–2 end‑to‑end projects:
- Start from a question, find or collect data, clean it, model or analyze, and write up insights.
- Emphasize decisions and trade‑offs, not just accuracy.
9.4 Neglecting Communication
- Over‑focusing on code and math, under‑focusing on how to explain your thinking.
- Many rejections are for “communication” or “stakeholder fit,” not technical gaps.
Fix:
- Practice explaining your projects to:
- A technical peer.
- A non‑technical friend.
- In mocks, explicitly structure answers:
- “I’ll answer in three parts: first…, second…, third…”
10. Putting It All Together: A 12-Week ML Interview Roadmap
Here is a sample 12‑week plan if you’re starting from near‑scratch and can allocate ~15–20 hours/week.
| Weeks | Focus Areas | Concrete Targets |
|---|---|---|
| 1–2 | Math & Stats | Basic probability, distributions, expectation, hypothesis testing; 20+ practice problems. |
| 3–4 | Python & Pandas | Complete 2 small data wrangling projects; solve 20 Python coding problems; read/write CSV, basic EDA. |
| 5–6 | SQL Fundamentals | Learn joins, aggregations, GROUP BY; solve 40 SQL problems including window functions. |
| 7–8 | Core ML | Implement linear/logistic regression, trees; understand metrics; do 1 small ML project end‑to‑end. |
| 9 | Analytics & A/B Testing | Learn metric design, funnels, experiment basics; work through 10 case questions. |
| 10 | Case Studies & Projects | Prepare 2–3 projects to discuss; write 1–2 page summaries for each. |
| 11 | Mock Interviews | 4–6 mocks (coding, ML, analytics, behavioral); refine weak areas. |
| 12 | Final Review | Revisit flashcards, redo tricky problems, rest before interviews. |
Adjust based on your background (e.g., if you already know Python, invest more in stats and ML).
11. Best Practices and Actionable Tips
A few principles to make your data science interview preparation more effective:
-
Interleave topics
- Don’t do 4 weeks of only ML. Mix stats, coding, and analytics each week to build integrated skills.
-
Bias toward real data
- Use public datasets (Kaggle, UCI, company blogs) instead of only synthetic examples.
-
Always explain your reasoning
- When solving problems, narrate your thought process as if in an interview.
-
Track your mistakes
- Maintain a “mistake log”:
- Question, your wrong answer, correct answer, root cause (concept gap, misread, rush).
- Review weekly.
- Maintain a “mistake log”:
-
Simulate real conditions
- Use time limits.
- Practice on a whiteboard or shared doc, not just a notebook.
-
Prepare strong project stories
- For each project, be ready to answer:
- What was the business problem?
- What data did you use? What were the challenges?
- What methods did you try and why?
- How did you evaluate success?
- What would you do differently?
- For each project, be ready to answer:
12. Key Takeaways
- Data science interview preparation is not just about ML; it’s a combination of statistics, coding, analytics, and communication.
- Start from the foundation: probability, statistics, Python, SQL, and data wrangling.
- Focus on a small set of core ML models and understand them deeply—especially how to evaluate and debug them.
- Analytics and experimentation skills—metric design, A/B testing, product sense—are critical, especially for product data science roles.
- Practice in interview‑like formats: timed coding, case studies, and mock interviews with feedback.
- Avoid common pitfalls: rote memorization, neglecting SQL and analytics, lack of real projects, and weak communication.
With a structured roadmap, deliberate practice, and consistent feedback, you can go from data science from scratch to confidently handling ML and analytics interviews end‑to‑end.