Data Science Case Studies for Interviews
Interviewers are not really testing whether you can compute a conversion rate. They are watching how you structure an ambiguous problem, which numbers you reach for first, how quickly you notice when the data contradict your hypothesis, and whether your final recommendation would survive contact with a product team. This lesson gives you one scaffold you can reuse across product analytics, experimentation, and estimation questions, then walks a complete engagement-drop case end to end so you can see the scaffold in motion.
The six-step scaffold that works for almost any question
Every product analytics prompt collapses into the same sequence, and having it memorised frees your attention for the actual reasoning. Clarify the problem first: ask what decision hinges on the answer, what timeframe matters, and what has already been ruled out. Then define metrics, because a metric tree separates the north star from the guardrails that stop you from gaming it. Structure the analysis into components you can measure independently, dive into the two or three segments most likely to hold the answer, and only then recommend an action with a monitoring plan attached.
The scaffold also tells you what to skip. Do not open with model selection, do not propose a dashboard before you know the decision, and do not compute everything you technically could. Depth on the segments that matter reads as seniority; breadth without a hypothesis reads as stalling.
Metric trees that survive follow-up questions
A north star metric without input metrics and guardrails is a number you cannot act on. The tree below shows how the three layers fit together for two very different businesses, and the pattern is the same in both: one outcome metric, a handful of drivers you can influence directly, and protections that catch you if a driver is improved at the expense of the user.
| Layer | Marketplace example | SaaS example | Purpose |
|---|---|---|---|
| North star | Completed bookings per week | Weekly active teams | Measures delivered value |
| Input metrics | Search conversion, supply hours, repeat rate | Activation rate, seats per account, feature adoption | Levers the team actually pulls |
| Guardrails | Cancellation rate, host no-show rate | Support ticket volume, churn | Prevents short-term wins that cost trust |
When an interviewer asks what you would watch after a change ships, answer with the guardrail column. It signals that you have shipped something before.
Funnel analysis that finds the leak
Funnel work is mostly about being precise with unit of analysis. Count unique users per step rather than raw events, decide whether the funnel is session-scoped or ever-scoped, and always report both cumulative conversion and step-to-step conversion, because a healthy overall number can hide one catastrophic step.
import pandas as pd
import numpy as np
def build_funnel(events, steps, segment=None):
"""Unique-user funnel with cumulative and step conversion."""
counts = (
events[events["event"].isin(steps)]
.groupby(["event"] + ([segment] if segment else []))["user_id"]
.nunique()
.rename("users")
.reset_index()
)
counts["order"] = counts["event"].apply(steps.index)
counts = counts.sort_values("order")
if segment:
counts["cumulative_rate"] = counts.groupby(segment)["users"].transform(
lambda s: s / s.iloc[0]
)
counts["step_rate"] = counts.groupby(segment)["users"].transform(
lambda s: s / s.shift(1)
)
else:
counts["cumulative_rate"] = counts["users"] / counts["users"].iloc[0]
counts["step_rate"] = counts["users"] / counts["users"].shift(1)
return counts
rng = np.random.default_rng(3)
n = 4000
events = pd.DataFrame({
"user_id": np.repeat(np.arange(n), 3),
"event": rng.choice(["view", "signup", "purchase"], n * 3, p=[0.6, 0.3, 0.1]),
"device": rng.choice(["mobile", "desktop"], n * 3, p=[0.7, 0.3]),
})
print(build_funnel(events, ["view", "signup", "purchase"]))
print(build_funnel(events, ["view", "signup", "purchase"], segment="device"))
Segmenting before you conclude is the highest-yield move in the whole exercise. A flat aggregate funnel frequently conceals a mobile regression hidden behind a stable desktop baseline.
Reading an experiment like a product manager
Experiment questions test whether you know when a result can be trusted. Before discussing lift, check three things: sample ratio mismatch, which reveals a broken assignment before any metric is read; duration, which must cover at least one full weekly cycle; and guardrail movement, which can veto a positive primary metric. Only after those pass is the effect size worth debating.
import numpy as np
from scipy import stats
def read_experiment(conversions_a, n_a, conversions_b, n_b, alpha=0.05):
"""Frequentist read with SRM check and confidence interval."""
half = (n_a + n_b) / 2
srm_p = stats.chisquare([n_a, n_b], [half, half]).pvalue
p_a, p_b = conversions_a / n_a, conversions_b / n_b
pooled = (conversions_a + conversions_b) / (n_a + n_b)
se = np.sqrt(pooled * (1 - pooled) * (1 / n_a + 1 / n_b))
z = (p_b - p_a) / se
p_value = 2 * (1 - stats.norm.cdf(abs(z)))
return {
"control_rate": p_a,
"treatment_rate": p_b,
"relative_lift": (p_b - p_a) / p_a,
"ci_95": ((p_b - p_a) - 1.96 * se, (p_b - p_a) + 1.96 * se),
"p_value": p_value,
"significant": p_value < alpha,
"srm_suspected": srm_p < 0.001,
}
print(read_experiment(1180, 10000, 1310, 10000))
Say out loud that a p-value of 0.03 on a 1 percent lift may still be a bad ship if the feature costs engineering time forever. Interviewers reward the connection between statistics and consequences.
Worked case: daily actives fell 12 percent
Suppose daily active users dropped 12 percent over ten days. Resist the urge to explain it immediately. First validate the signal: confirm the drop is not a tracking change, a bot wave, or a calendar effect, and check whether sessions per user and session length moved together or whether only the headcount metric fell. Next segment by device, geography, platform version, and acquisition channel, then rank segments by contribution to the absolute decline rather than by percentage change, since a small segment can show a dramatic percentage and barely matter.
Only after segmentation do you correlate with the release log. If the mobile app shipped on day three, APAC suffered most, and latency rose after a migration on day six, you have three candidate causes with three different owners. Form a ranked hypothesis with an expected signature for each: a UX regression should hit activation and task completion, a latency problem should hit session length and error rate, a deprecation should hit a specific feature's usage. Then propose the cheapest test for each, which is usually a rollback, a targeted fix, or an experiment rather than a quarter-long investigation.
Close with monitoring: define the metric that tells you the fix worked, the date you will check it, and the guardrail that would make you reverse the decision.
import pandas as pd
import numpy as np
def contribution_to_decline(baseline, current):
"""Rank segments by absolute contribution to an aggregate drop."""
df = pd.DataFrame({"baseline": baseline, "current": current}).fillna(0)
df["delta"] = df["current"] - df["baseline"]
df["share_of_drop"] = df["delta"] / df["delta"].sum()
df["pct_change"] = df["delta"] / df["baseline"]
return df.sort_values("delta")
print(contribution_to_decline(
baseline={"mobile_us": 5200, "mobile_eu": 3100, "desktop_us": 4100, "tablet": 900},
current={"mobile_us": 4300, "mobile_eu": 2750, "desktop_us": 4050, "tablet": 880},
))
Ranking by absolute contribution changes the story: the biggest percentage drop is often not the segment that actually moved the company number.
When the data will not cooperate
Real cases rarely arrive with a clean table. Sometimes the instrument is broken and you must reconstruct a metric from proxy events; sometimes the sample is too small for the segment you care about; sometimes the segment that matters most is exactly the one with no coverage. Naming these constraints out loud is part of the answer, because a recommendation built on a metric you cannot measure reliably is a recommendation that will fail in production.
A useful habit is to state the confidence you have in each input before you lean on it. If the funnel counts unique users from a pixel that fires inconsistently on mobile Safari, say so, and propose a reconciliation against server-side logs before any conclusion is drawn. If a segment holds forty users, report the direction with an explicit caveat rather than a decimal place that implies precision you do not have. Interviewers notice candidates who distinguish what the data shows from what they would like it to show, and they trust the candidates who flag their own evidence gaps before being challenged on them.
How interviewers actually score you
Most rubrics reward the same four behaviours. Clarity of problem restatement earns credit before any number appears. A structured decomposition shows that you will not drown in a messy dataset. Hypothesis-driven depth beats unfocused exploration, and a recommendation with a metric, an owner, and a rollback condition shows you understand that analysis exists to change something. Communication is scored continuously, not at the end: an interviewer who cannot follow your reasoning stops giving you credit even when your arithmetic is right.
Practise out loud, on two cases a week, with a timer. Say your assumptions explicitly, narrate your segment choices, and pause to check whether the interviewer wants depth or breadth. The candidates who struggle most are usually the ones who know the statistics but have never rehearsed saying them.
Common Mistakes
Jumping to a model or a dashboard before clarifying the decision the analysis must inform
Fix: Ask what changes if the answer is A rather than B, then design only the analysis that decision needs.
Reporting a single aggregate funnel or metric without segmenting
Fix: Break the number down by device, geography, and cohort, and rank segments by absolute contribution to the change.
Declaring an experiment winner from lift and p-value alone
Fix: Check sample ratio mismatch, duration, and guardrails first, then state the business tradeoff behind the statistic.
Best Practices
- Restate the problem and confirm scope before calculating anything
- Define north star, input, and guardrail metrics early so later tradeoffs have a frame
- Rank segments by absolute contribution rather than percentage change
- Lead the final answer with the recommendation, then support it with evidence
- Rehearse two cases a week under a timer to make the scaffold automatic
Interview Questions
Q1: How would you investigate a 12 percent drop in daily active users?
Validate the signal against tracking and calendar effects, segment by device, geography, and version, rank segments by absolute contribution, correlate with the release log, form ranked hypotheses with expected signatures, and propose the cheapest test for each plus a monitoring plan.
Q2: What is the difference between a north star metric and a guardrail metric?
The north star measures delivered value and guides prioritisation, while guardrails protect against short-term gains that damage trust or revenue, such as cancellation rate, support volume, or churn.
Q3: Your experiment shows a 1 percent lift with a p-value of 0.03. Do you ship?
Not automatically. I would check sample ratio mismatch, duration, and guardrail movement, then weigh the lift against implementation cost and risk, since a statistically reliable but economically trivial change may not be worth maintaining.
Q4: Why segment before forming a hypothesis?
Aggregate metrics mix populations with different behaviour, so a stable segment can mask a regression in another. Segmenting first tells you where the change actually lives and prevents a hypothesis built on an average that nobody experiences.
Key Takeaways
- Use one scaffold: clarify, define metrics, structure, segment, recommend, monitor
- Metric trees need input metrics and guardrails, not just a headline number
- Count unique users per funnel step and always report step-to-step conversion
- Check SRM, duration, and guardrails before reading any experiment lift
- Rank segments by absolute contribution, because the largest percentage rarely moves the business