Contents

A/B Testing Interview Questions for Data Scientists and Analysts | OfferBull

A/B Testing Interview Questions for Data Scientists and Analysts

They put a dashboard on the shared screen. Treatment is two percent ahead on click-through. Revenue has not moved. Then they ask what you’d ship.

If you say “it won, ship it” and stop, you have not answered. They want to know whether clicks were the primary metric, whether anyone peeked at the p-value mid-flight, and whether a mid-funnel click lift should have moved revenue at all.

That is what A/B testing interview questions feel like. Experiment design, primary metrics and guardrails, power and sample size at a conceptual level, and the pitfalls that quietly wreck a read. This is a spoken question bank, not a week-by-week data science study plan. For the broader loop, use how to prepare for data science interviews. If a follow-up turns into a product-sense “how would you measure this,” that is closer to product manager interview questions.

The answers below are illustrative. Practice them out loud. You will hear the slogans you lean on only when you have to say them to someone.

Experiment design, metrics, and guardrails

The opening question is usually some version of: how would you design this test?

I’d start with the decision, not the tooling. What would we do if the test wins, and what would we do if it loses? Then a hypothesis you can actually falsify: this checkout change will raise completed purchases, not “it will make the experience better.” Name the unit of randomization next. User-level assignment is the default when a person should see one consistent experience. Session-level is tempting when you want a larger sample, and it is often the wrong call: the same person can sit in both arms and the experience flips. Order-level can be right for a pricing or fulfillment change, if the decision really lives on that object.

Primary metric versus guardrails is the part people rush. One primary metric, chosen before launch, is what the test is powered to decide. Guardrails are the things that can go wrong even if the primary metric moves: revenue per user, error rate, latency, refunds, unsubscribe, a downstream conversion you cannot afford to tank. I would not power the test on eight metrics and then pick the green one later. That is metric fishing, and interviewers listen for it.

A pre-analysis plan, at a practical level, is the short list I’d write down before assignment starts: hypothesis, unit, population, primary metric and its window (purchase in seven days, not “sometime”), guardrails, planned runtime, and what would make us throw the test out, such as a sample ratio mismatch or a tracking bug. You do not need a formal paper. You do need a record so the team cannot quietly change the target after seeing the chart.

A spoken version I’d actually use:

“I’d start with the decision this test is meant to support. The hypothesis is that the new checkout raises completed purchases per user, not clicks. I’d randomize at the user, so the same person doesn’t see both flows. Purchases in seven days is the primary metric. Guardrails are revenue per user, payment errors, and refunds. I’d write that down before we start, including the planned runtime, so we aren’t shopping for a metric later.”

/images/posts/ab-testing-interview-questions/experiment-flow.svg

The flow I’d draw first: hypothesis, unit, primary metric and guardrails, then runtime and analysis.

Power and sample size, conceptually

Then they ask how long the test should run, or how many users you need. They are not asking you to invent a calculator result in the room.

Power, in speech, is the chance you’d detect an effect of a size you actually care about, if that effect is real. The minimum detectable effect is the smallest lift the design is built to catch at that power and significance level. If the team hopes for a one-percent lift in purchases and the test is only sensitive to a five-percent lift, a “not significant” result does not mean the change failed. It means you never gave the one-percent effect a fair look.

What I’d ask for before promising a date: the baseline rate, how noisy the metric is, the smallest lift that would still be worth shipping, and the error rates the team is willing to live with. I would not recite a formula I cannot defend. The sample you need goes up when the effect is smaller, when the metric is noisier, when a binary baseline sits near the middle of the range (variance is higher there), and when you want a tighter false-positive rate or higher power. A rare conversion needs more users than a frequent click. A tiny expected lift needs a long runtime, or a bigger audience, or both. I would not promise Friday if the traffic cannot support the effect the team is describing.

If they mention CUPED or a similar covariate adjustment, keep it short and accurate. You use pre-experiment data, often the same metric from a prior window, to reduce variance. That can shrink the sample you need, or give a tighter read in the same window. It is not a substitute for randomization, and it does not fix a bad metric.

A spoken answer I’d use:

“I wouldn’t pick an end date from a calendar. I’d ask for the baseline, how noisy the metric is, and the smallest lift we’d still ship. The test needs enough users to have a real chance of seeing that lift if it’s there. A one-percent purchase lift on a noisy metric will take longer than a big click lift. If they want a date anyway, I’d say what the test is powered for, and what we should not conclude if we stop early.”

/images/posts/ab-testing-interview-questions/power-timeline.jpg

A design board: two arms, and a runtime you can defend before anyone peeks.

Pitfalls interviewers actually probe

The trap I hear most is casual peeking. Someone opens the dashboard every morning, sees a p-value cross 0.05 on day four, and stops the test because it is “already significant.” That optional stopping inflates the false-positive rate. The p-value you were taught assumes a fixed sample, or a procedure that already accounts for interim looks. Looking often, and stopping when the number turns green, is not that procedure. I’d pre-commit to a horizon, or use a sequential method that is valid for interim looks. I would not treat 0.05 as a magic switch.

Novelty and primacy show up on UI changes. Novelty: people click the new thing because it is new, and the lift fades. Primacy: people stick with the old habit, and a real effect only appears later. If the runtime is shorter than the habit cycle, you can read either one as the truth. I’d say how long I’d watch after a visual change, and whether I’d hold out a slice to see if the effect lasts.

Seasonality is the cousin of a short runtime. Launch on a holiday weekend, or mix a quiet Tuesday with a payday Friday, and the calendar can move the metric more than the treatment. A horizon that covers a full business cycle is dull advice, and it is usually the right advice.

Sample ratio mismatch is a data-quality check, not a curiosity. If you assigned 50/50 and the observed split is off by more than chance would allow, something is wrong in assignment, logging, or filtering. I would not analyze the test as if the read were valid until that is explained. The same instinct applies to instrumentation bugs: a missing event on one arm looks like a lift, or a drop, and it is neither.

Interference, or network effects, is the case where one user’s treatment changes another user’s outcome. A social feature, a marketplace, a limited pool of drivers or listings. The usual user-level test assumes units do not spill into each other. When they do, the result may not hold when you ship to everyone. Cluster randomization, a market-level test, or a switchback (time-based alternation) can be the better design, and I’d only name them if I can say why. Switchbacks need a stable period length and still struggle when effects linger.

Multiple comparisons belong in the same breath as peeking. Ten metrics, twenty slices, one “significant” region. I would not let a slice become the launch case after the fact. Heterogeneous effects are real, and they need a pre-specified cut or a later, dedicated test, not a fishing trip through the dashboard.

A spoken version of the peeking trap:

“If I checked every morning and stopped when it went green, I wouldn’t trust that p-value. I’d set a horizon, or use a sequential method built for interim looks. A fixed date is boring. It is also how you avoid talking yourself into a win.”

Case prompts you can talk through

These are fictional prompts, the kind you should rehearse out loud. The interviewer will change the product. The shape of the answer should still hold.

“The test looks inconclusive. What do you do?”

I would not ship because the line is “directionally positive.” I’d check whether we ever had a chance: was the test powered for the lift we care about, or did we stop early? I’d look at variance, at whether a tracking bug or an SRM makes the read unusable, and at whether a noisy weekday pattern ate the window. If the data are clean and we were powered for a meaningful lift, a null is a result. Keep the control, or run a tighter follow-up if a smaller effect is still worth the wait. I would not keep stretching the same test until it cooperates.

“Clicks are up, revenue is flat. Do we ship?”

This is the dashboard they showed you at the start. I’d ask what the primary metric was. If it was clicks, I’d still not ship on that alone when revenue and completed purchases were the business decision. A click lift can be curiosity, a more aggressive button, or a path that adds a step without adding a purchase. I’d check delayed revenue, mix shifts, refunds, and whether a new click is being counted that the old design never fired. If purchases and revenue are guardrails and they are flat or down, I would not call it a win. A product follow-up about which metric should have been primary sits closer to product manager interview questions.

/images/posts/ab-testing-interview-questions/clicks-revenue-case.jpg

Talk through the case out loud: primary metric, window, and why a click lift may not be a win.

“Should we even A/B this?”

Not every change earns a test. I would not run one when you cannot randomize fairly, when the effect would take months to show up in the traffic you have, when the launch is a one-way legal or safety change, or when you are fixing a clear bug and waiting costs more than a wrong read. I’d also hesitate when interference is so severe that a user-level test cannot give a clean answer and you do not have a better design ready. “We should test everything” sounds disciplined. It can also delay a decision you already have enough evidence for.

“This is a social feature. Friends will see different versions.”

I’d name the interference instead of forcing a standard user split. If my treated user posts more, their control friends see a different feed, and the control arm is no longer a clean counterfactual. I might cluster by a group, or use a switchback if the product can take a time-based design. I’d also say what I would not claim: a user-level lift here may shrink, or flip, when everyone is treated. Marketplace inventory works the same way. Two buyers in different arms can still compete for the same listing.

Night-before drill

I’d run these out loud, timer on, no notes after the first pass:

  • Design one test: hypothesis, unit of randomization, primary metric, two or three guardrails, and the planned runtime
  • Explain, in under a minute, what “powered for a minimum detectable effect” means, and what you’d ask for before promising a date
  • The peeking trap: why a green p-value on day four is not a stopping rule
  • Walk the “clicks are up, revenue is flat” case, including what would make you throw the test out
  • One interference example, and why a plain user split can lie

If a line sounds like a slogan (“we need statistical significance”), say it again until it names a decision, a metric, or a bug.

Practicing with OfferBull

A list of pitfalls will not tell you whether you paused before “ship it, the test won.”

OfferBull is an AI mock interview app, available on iOS and Android. A voice interviewer asks questions aloud. You answer by speaking. Paste a data scientist, analyst, or experimentation-heavy job description, or upload a resume, for tailored questions. Follow-ups based on what you said and what’s on the resume. While you practice, you get answer suggestions and STAR structures. English and Chinese. It’s for rehearsal before the interview, not a helper during one.

Start an AI mock interview

FAQ

Is p < 0.05 a ship rule? No. A threshold is a planning choice, not a law. Peeking, a wrong primary metric, a tracking bug, or an underpowered test can all give you a number that looks tidy and still be the wrong decision.

What is sample ratio mismatch, and should I still analyze the test? SRM means the observed split doesn’t match the assignment you intended, beyond what chance would allow. Treat it as a data-quality alarm. I’d investigate assignment, logging, and filters before I trusted the read.

When would you not run an A/B test? When you can’t randomize fairly, when the effect would take longer than you can wait, when the change is a clear safety or bug fix, or when interference would wreck a user-level read and you don’t have a better design.

Do I need to derive a sample-size formula in the room? Usually no. You do need to say what makes the required sample go up or down, and you should not invent a calculator output you can’t defend.

Is CUPED a reason to skip randomization? No. It is a variance-reduction method that uses pre-experiment data. It can give a tighter read. It does not replace a proper assignment.


Practice This Out Loud

Tonight, talk through one experiment design, a conceptual power answer, and the peeking trap, each in under a minute. Then do the clicks-up, revenue-flat case with no dashboard in front of you: primary metric, window, instrumentation, and what you would not ship. Record it and listen for filler, and for answers that stop at “it’s significant.” After that, run the same questions in a voice mock that pushes back, and close the app before any real interview. → Practice Now


Take Control of Your Career Path: