How to Prepare for a Data Scientist Interview in Two Weeks
How to prepare for a data scientist interview in two weeks, day by day, with SQL and statistics drills, a story bank, timed mocks and a 3-day crash plan.
Updated
To prepare for a data scientist interview, spend two weeks rebuilding experiment statistics by hand, drilling SQL at the right grain, writing plain Python over messy records, rehearsing metric-diagnosis cases out loud, and writing five true stories with numbers in them. Take three timed mock interviews, on days 1, 7 and 12, and spend the days after each one fixing what they exposed.
This plan is for a product or analytics data scientist role, the kind where you design and read A/B tests, explain why a metric moved and recommend what to do. It assumes about 75 minutes on weekdays and two to three hours at weekends. The data scientist interview guide explains the rounds and how they are scored; this post is the training schedule that sits underneath it.
How to prepare for a data scientist interview in two weeks, where the hours go#
Weight your hours the way interviewers weight scores: experimentation and metrics usually decide the outcome, while coding and SQL are gates to clear.
At 75 minutes on weekdays and two to three hours at weekends, you have about 21 to 24 hours. Spend 20 of them like this, and keep the rest for reviewing mocks:
- Statistics and experimentation, about 6 hours: power, sample size, confidence intervals, and the traps that break real tests.
- Metrics and product cases, about 4 hours: metric trees, diagnosing drops, choosing success and guardrail metrics.
- SQL, about 3 hours: joins, window functions, cohort retention, deduplication.
- Python, about 3 hours: dictionaries, sorting and a hand-written significance test, without pandas.
- Stories and communication, about 2 hours: five stories and two stakeholder explanations.
- Timed mocks, about 2 hours: one each of 30, 45 and 60 minutes.
Most loops test the same four things under different labels: design a test, read a result, write the query, explain it to a product manager. Move hours towards any round the job description names, such as a take-home. The demand is real: the US Bureau of Labor Statistics' Occupational Outlook Handbook gives a median annual wage of $120,230 in May 2025 and projects 35% employment growth from 2025 to 2035, so expect competitive loops.
Before day 1, set up three files#
Create one working document with three sections:
- Formula sheet: everything you derive by hand. If you cannot write it from memory by Day 14, you do not know it yet.
- Story bank: the five stories described below.
- Mistake log: every error a mock or drill exposes, with the fix. Re-read it before each mock.
Then set up a SQL environment. Use DuckDB (pip install duckdb), which runs in a notebook with no server. The queries below use DuckDB and PostgreSQL syntax; SQLite lacks DATE_TRUNC and INTERVAL, so if you must use it, replace them with strftime and date(signup_date, '+7 days'). Create three small tables yourself: users(user_id, signup_date, country), orders(order_id, user_id, order_ts, amount, status) and exposures(user_id, variant, first_exposed_ts). Put deliberate mess in them: duplicate orders, cancelled orders, users exposed to both variants, days with no orders, and timestamps near midnight. You will reuse these tables for every SQL and Python drill.
Week 1, rebuild the foundations#
Day 1, cold baseline mock#
Take a 30-minute mock before you revise anything. Write down your two weakest skills and three sentences you would not want quoted back to you. Typical first-mock problems: a p-value reported without checking the split, a cause guessed in a metric drop, a query that double-counts after a join.
Then write the two-proportion z-test on your formula sheet from scratch: pooled rate, standard error, test statistic, p-value.
Day 2, power and sample size by hand#
Learn the rule of thumb that Ron Kohavi, Diane Tang and Ya Xu use in "Trustworthy Online Controlled Experiments" (2020): with a two-sided alpha of 0.05 and 80% power, each arm needs roughly n = 16 * variance / delta^2 units. The 16 comes from 2 times (1.96 + 0.84) squared, which is about 15.7.
Work one example out loud until you can do it in under two minutes:
Baseline checkout conversion p = 0.10
Variance of a 0/1 metric p(1 - p) = 0.09
Smallest lift worth detecting 0.5 percentage points (delta = 0.005)
n per arm = 16 * 0.09 / 0.005^2
= 1.44 / 0.000025
= 57,600 users per armWith 20,000 eligible users a day split 50/50, that is about six days of traffic, but you would still run two full weeks to cover weekly cycles. Follow-ups: half the traffic doubles the run time; half the effect quadruples the sample, because delta is squared.
Day 3, the traps that break real experiments#
Study five failure modes and write one sentence on each in your formula sheet:
- Sample ratio mismatch: the split differs from the design more than chance allows. Check with a chi-squared test. For a planned 50/50 test with 50,600 and 49,400 users, the statistic is 2 × 600² / 50,000 = 14.4, a p-value of roughly 0.00015. Distrust the result until you find the cause, often an assignment bug, a redirect that drops users, or uneven bot filtering.
- Peeking: checking significance daily and stopping when p dips below 0.05 inflates false positives. If the team must look early, name a method: a group sequential design with O'Brien-Fleming boundaries (a strict threshold at early looks, close to 0.05 at the final one), or always-valid p-values from the mixture sequential probability ratio test (mSPRT), which underpins Optimizely's Stats Engine. Either way, the stopping rule is fixed before launch.
- Novelty and primacy effects: curiosity clicks, or regulars resisting change. Plot the effect by day since first exposure.
- Interference: when treatment and control compete for the same scarce resource, such as drivers, inventory or delivery capacity, the measured effect is biased. Know when to propose a cluster, geographic or switchback design.
- Multiple comparisons: ten independent metrics at alpha 0.05 give a 1 - 0.95^10, about 40%, chance of at least one false positive. Name one primary metric before launch, and for the secondary metrics either divide alpha by the number of tests (0.05 / 10 = 0.005) or control the false discovery rate.
Finish with variance reduction. CUPED, from a 2013 WSDM paper by Deng, Xu, Kohavi and Walker at Microsoft, adjusts each user's outcome using their own pre-experiment value of the same metric, which shrinks variance and shortens tests. Be ready to explain it in one sentence and to say when it helps little: for new users with no history.
Day 4, SQL at the right grain#
Spend 75 minutes on your messy tables. The skill tested is deciding the grain of each step before writing it. Four drills:
- Weekly active customers, counting each customer once per week, excluding cancelled orders.
- First-order conversion within seven days of signup, by signup week.
- The latest order per customer using
ROW_NUMBER(). - A 30-day retention cohort table.
A version of drill 2 that a strong candidate would write and then narrate:
WITH first_orders AS (
SELECT user_id, MIN(order_ts) AS first_order_ts
FROM orders
WHERE status <> 'cancelled'
GROUP BY user_id
)
SELECT
DATE_TRUNC('week', u.signup_date) AS signup_week,
COUNT(*) AS signups,
COUNT(f.user_id) FILTER (
WHERE f.first_order_ts < u.signup_date + INTERVAL '7 days'
) AS converted_7d
FROM users u
LEFT JOIN first_orders f ON f.user_id = u.user_id
GROUP BY 1
ORDER BY 1;Say out loud why aggregation comes before the join (one row per user cannot multiply users) and why it is a LEFT JOIN (users who never ordered stay in the denominator). Interviewers listen for those two sentences.
Day 5, plain Python over messy records#
Coding rounds often hand you lists of dictionaries and forbid pandas. Write a function that turns exposure and order records into conversion by variant and a p-value: drop users exposed to both variants, count only orders after first exposure, count each user once.
from math import erf, sqrt
def two_proportion_test(conv_a, n_a, conv_b, n_b):
if n_a == 0 or n_b == 0:
return None, None
p_a, p_b = conv_a / n_a, conv_b / n_b
pooled = (conv_a + conv_b) / (n_a + n_b)
se = sqrt(pooled * (1 - pooled) * (1 / n_a + 1 / n_b))
if se == 0:
return p_b - p_a, None
z = (p_b - p_a) / se
p_value = 2 * (1 - 0.5 * (1 + erf(abs(z) / sqrt(2))))
return p_b - p_a, p_valueTest the edges: an empty arm, an arm with no conversions, an order one second before exposure. Check your output against proportions_ztest in statsmodels, then redo the drill from memory.
Day 6, metric trees and diagnosis cases#
Do two diagnosis cases out loud, 12 minutes each, recording yourself. Invent prompts from products you use: "Weekly orders fell 6% last week" or "Average session length on a streaming app is up 10% but subscriptions are flat".
Use the same opening sequence every time, so it becomes automatic:
- Confirm the definition and the comparison: which metric, which period, compared with what.
- Rule out data problems: logging changes, a pipeline delay, a new app version, a tracking outage.
- Check for external causes: seasonality, a holiday, a competitor promotion, weather.
- Decompose the metric: orders equal active customers times orders per customer; split by new and returning, platform, region and channel.
- Separate mix from rate: did the population change, or did the same people behave differently?
- End with what you would do next and what result would change your mind.
Naming a cause in the first minute, before ruling out data problems, is the most common way to fail a diagnosis case; interviewers usually respond with "how do you know?" and the rest of the case becomes a defence.
Day 7, first-week mock and review#
Take a 45-minute mock and compare it with Day 1 skill by skill. Move anything that has not improved to the top of week 2, then draft your five stories (see the story bank below).
Week 2, rehearse under realistic pressure#
Day 8, experiment design from a blank page#
Design three experiments out loud, ten minutes each: a new onboarding flow, a price change on a subscription, and a ranking change in a marketplace where buyers compete for limited stock. For each, state the hypothesis, the unit of randomisation, the primary metric, two guardrail metrics, the sample size estimate and the run length, and one reason the result could mislead you.
On pricing, randomising by user invites fairness complaints, so a geographic or new-customers-only test may be more defensible. Saying that trade-off is worth more than a perfect formula.
Day 9, reading a messy readout#
Write a fake readout with problems in it: a primary-metric lift at p = 0.04, a guardrail that moved the wrong way, eight segments and a slightly uneven split. Critique it as if a product manager asked "Can we ship this?". Order the checks: is the split sound, was the stopping rule followed, does the effect matter, did a guardrail fail, and are segment results noise from many comparisons.
Practise a confidence interval sentence a non-specialist can follow: "Our best estimate is a 2.1% lift in conversion, and the data are consistent with anything from about 0.4% to 3.8%. Even the low end pays for the engineering cost, so I recommend shipping."
Day 10, causal questions without an experiment#
Some cases are about things that cannot be randomised, such as a loyalty programme or a city launch. Prepare four tools:
- Difference-in-differences: compare the change in a treated region with the change in a similar untreated region over the same period. Example: orders per customer in the launch city rose from 4.0 to 4.6 a month; in the comparison city they rose from 3.8 to 4.1. DiD = (4.6 - 4.0) - (4.1 - 3.8) = 0.3 orders, about 7.5% of the launch city's baseline. Then check that the two cities' lines ran parallel for the eight weeks before launch; if they did not, the 0.3 is not credible.
- Matching or regression adjustment: compare members with similar non-members on pre-joining behaviour; name selection bias as the problem you are reducing, not removing.
- Regression discontinuity: use a threshold, such as free delivery above a basket value, to compare customers just either side of it.
- Holdouts: propose a small permanent control group for a programme that is already live.
Explain one to an imagined finance director in 90 seconds.
Day 11, SQL and Python under the clock#
Two SQL problems at 12 minutes each and one Python problem at 20, talking throughout: deduplicate an events table where retries produce near-identical rows; compute a rolling seven-day average of orders per city; find users whose spend dropped by more than half from one month to the next.
The rolling average hides the most common window-function trap:
SELECT
city,
order_date,
AVG(daily_orders) OVER (
PARTITION BY city
ORDER BY order_date
RANGE BETWEEN INTERVAL '6 days' PRECEDING AND CURRENT ROW
) AS avg_7d
FROM city_daily_orders;ROWS BETWEEN 6 PRECEDING counts rows, not days; if a city has no orders on some day, ROWS silently spans eight or more calendar days. Either use RANGE as above, or join to a date spine first so every city has a row for every day; the spine is right when a quiet day should count as zero. After each drill, note the edge case you nearly missed.
If your role leans towards modelling, swap the Python drill for a walkthrough of metric choice for an imbalanced classifier and time-based validation; the ML engineer interview prep plan goes further.
Day 12, full-length mock with stakeholder pressure#
Take a 60-minute mock, including the stakeholder role-play. Before it, rehearse this prompt once: the product manager says, "The test is at p = 0.08 after one week, the launch is Friday, can we just ship?"
A strong reply sounds like this: "Not on this data. The interval runs from minus 0.2% to plus 3.0%, so a small loss is still possible. Two options: run the second planned week, which gets us to the sample size we agreed, or ship to 90% and keep 10% as a holdout that we read in two weeks. If Friday is fixed, I'd pick the holdout."
What scores well is a decision, a range and an alternative, in that order. What scores badly is a lecture on p-values, or "it depends" with no follow-through. Afterwards, search the scorecard quotes for "we saw a lift" with no number or interval.
Day 13, targeted repair#
Rewrite the three weakest Day 12 answers and say them aloud twice. Any mistake that appears three times in your log goes on a card for the morning of the interview.
Day 14, light review and questions to ask#
No new material. Re-read your formula sheet and stories, and prepare three questions only a data scientist would ask: how experiment readouts are reviewed before decisions, what share of the team's work is experimentation compared with ad hoc analysis, and who owns metric definitions when product and finance disagree.
How to build a story bank for data scientist behavioural rounds#
Write five stories, each proving something different:
- Your analysis changed a decision, with a number in it.
- A result people did not want, such as a null test on someone's favourite feature.
- A mistake in your analysis: how it was found and what you changed.
- A disagreement about method or metrics with a product manager or engineer.
- Ambiguity you turned into a plan: a vague request scoped into an answerable question.
Use one template for all five, and keep each under 90 seconds when spoken:
Story title:
Situation (one sentence, with scale):
My specific responsibility:
The hard part (the constraint or the conflict):
What I did (three steps, first person):
Result (a number, and the decision it led to):
What I would do differently:
Follow-up I expect, and my answer:A worked outline for story 2, the kind a strong candidate gives:
- Situation: "A redesigned checkout had been championed by our VP and we ran a two-week test on about 120,000 users."
- Hard part: "Conversion was flat, with a confidence interval from minus 0.6% to plus 0.5%, and the launch was already on the roadmap."
- Action: "I checked the split and the logging first so nobody could dismiss the result as a bug. Then I showed that the interval ruled out the 3% lift the business case assumed. I proposed keeping the two parts of the redesign that reduced support tickets and dropping the rest."
- Result: "We shipped the smaller version, saving about six weeks of engineering time, and the team adopted a minimum detectable effect in every test plan after that."
It states scale, gives an interval rather than "it didn't work" and ends with a decision.
How to review a mock interview so the next one is better#
The pillar guide covers what each mock length contains. This plan takes them in rising order of length; the review is where the improvement happens.
- Review for as long as the mock lasted, on the same day.
- Copy every weak quoted sentence into the mistake log, then write and say aloud a better version. "The result was significant" becomes "conversion rose 1.8%, interval 0.3% to 3.3%, the split checked out".
- Tag each mistake by skill: statistics, metrics, SQL, Python, communication. Two tags in the same skill decide what the next two days cover.
- Check the last quarter of the longest mock separately. Answers often get vaguer as tiredness sets in; if yours do, rehearse closing sentences, not more content.
You can practise a timed 30, 45 or 60 minute Data Scientist mock interview with live Python and a scorecard that quotes what you said.
What to practise out loud every day#
Ten minutes a day, because knowing it and saying it clearly under pressure are different skills:
- One concept to a non-specialist: p-value, power, confidence interval, selection bias or CUPED, each in under 60 seconds, as if to a marketing lead. A good p-value sentence: "If the change truly did nothing, we would see a difference at least this large less than 3% of the time."
- One vague prompt, such as "Is the new feature working?": list five clarifying questions before answering.
- One story and one recommendation sentence: a story at 90 seconds, and a decision, a number, a range and a risk, in that order.
What to do the day before and the morning of the interview#
- Day before: write the two-proportion test and the sample size rule from memory on a blank page, and say all five stories aloud once. Check which editor or notebook the coding round uses and which SQL dialect is expected.
- Day before: pick the two metrics you would most want to discuss for that product, such as churn for a subscription business or supply balance for a marketplace. Stop by early evening.
- Morning: read your mistake-log card, such as "check the split first", "aggregate before joining" and "give a number and a range", then do one ten-minute metric diagnosis out loud as a warm-up.
The 3-day version if your interview is soon#
If the interview is in three days, cut breadth and keep the mocks.
Crash day 1#
Take a 30-minute mock cold, then spend 90 minutes on the two-proportion test, the sample size rule with one worked example, and one sample ratio mismatch check. These are the statistics topics the Kohavi, Tang and Xu book treats as the minimum for trustworthy tests, and they underpin both the experiment and readout rounds.
Crash day 2#
One hour of SQL: a funnel with a LEFT JOIN, a window function and a retention cohort. Then two diagnosis cases with the six-step opening, and three stories: a decision you changed, a result nobody wanted, a mistake you fixed.
Crash day 3#
Take a 45 or 60 minute mock in the morning, rewrite the weakest answers in the afternoon, and stop early.
For the questions themselves, use the data scientist interview questions post, and before you apply, read the things to know before applying for a data scientist job. For a nearby role, see the data engineer interview prep plan.
Frequently asked questions#
How long does it take to prepare for a data scientist interview?#
Two weeks of about an hour a day is enough for most working analysts and data scientists who already write SQL and know basic statistics. If you have not run an A/B test or written SQL recently, allow three to four weeks and repeat the statistics and SQL days. Three days works only if you focus on experiments, metric cases and one or two timed mocks.
What should I study first for a data scientist interview?#
Start with experiment statistics: the two-proportion test, confidence intervals, power and sample size, and sample ratio mismatch. These carry the most weight in product data science loops and underpin the case rounds too. Then move to metric diagnosis, SQL at the right grain and plain Python, and leave behavioural stories until the end of the first week.
How many mock interviews should I do before a data scientist interview?#
Three timed mocks over two weeks works well: a 30-minute diagnostic on day 1, a 45-minute progress check at the end of week 1 and a 60-minute dress rehearsal two days before the end. Review each one for at least as long as it lasted, and fix the quoted weak answers before taking the next mock.
Do I need machine learning for a product data scientist interview?#
Usually only at a conceptual level. Product and analytics data scientist loops focus on experimentation, metrics, causal reasoning and SQL, and may include one question on a model you built. If the job description mentions modelling, forecasting or ranking, add a session on evaluation metrics, time-based validation splits and explaining precision and recall trade-offs to the people who use the predictions.
Which books help with data scientist interview prep?#
"Trustworthy Online Controlled Experiments" by Ron Kohavi, Diane Tang and Ya Xu is the standard reference on A/B testing in practice, covering sample ratio mismatch, variance reduction and pitfalls. "Ace the Data Science Interview" by Nick Singh and Kevin Huo collects 201 practice questions across statistics, SQL, product sense and machine learning, which suits drill sessions.