Statistical Inference and Hypothesis Testing Questions
Reasoning about uncertainty in data and drawing formal conclusions from samples. Covers probability rules and common distributions, the Central Limit Theorem, sampling, standard error, confidence intervals, and Bayesian reasoning, together with the significance-testing framework: null and alternative hypotheses, p-values, statistical power, Type I and Type II errors, effect sizes, and choosing the right test (t-test, chi-square, non-parametric). Emphasizes correctly interpreting statistical results and avoiding common misreadings of significance in business and product contexts rather than memorizing formulas.
You need to determine a sample size to estimate average customer lifetime value within a margin of error of 0.5 units at 95% confidence. Population standard deviation is unknown but a pilot sample of 40 customers gives sd ≈ 4. Describe the steps to compute a recommended sample size and show the calculation using the pilot sd. Discuss any iterative steps you would take in practice.
Sample Answer
Direct answer
Solve the margin-of-error formula backward for n: given a target margin E, a confidence level (95%, so z∗=1.96), and an estimate of the standard deviation from a pilot sample, the required sample size is n=(z∗s/E)2, rounded up. With the pilot's s≈4 and a target margin of 0.5, that comes out to about 246 customers, treated as a starting plan to be revisited once real data comes in.
Structured elaboration
Setting up the formula. A 95% CI for a mean has half-width (margin of error) E=z∗⋅SE=z∗⋅ns. Solving for n:
n=(Ez∗s)2Using z∗=1.96 for planning (not t) is a standard simplification: at the sample sizes this formula tends to produce, t and z are close enough that using z up front and refining with t afterward is fine.
Why the pilot is only a starting point. The formula needs a standard deviation, but the true population σ for customer lifetime value is unknown; that's exactly what the 40-customer pilot supplies as an estimate. Because it's an estimate from a small sample, it's noisy, and CLV in particular is often right-skewed with a long tail of high-value customers, which can make a 40-person pilot understate the true variance if none of the top-tail customers happened to land in it.
Worked example
Target margin E=0.5, 95% confidence (z∗=1.96), pilot standard deviation s=4 from npilot=40:
n=(0.51.96×4)2=(15.68)2≈245.9⇒n=246(Verified by direct computation.) If historical response/completion rates for this kind of data pull run around 80%, plan to sample or invite more than 246 to end up with 246 completed observations: 246/0.8=307.5⇒308 invites.
Iterative refinement in practice.
- Collect the initial planned batch (or an early tranche of it).
- Recompute the sample standard deviation from the larger, more reliable batch. If it's meaningfully different from the pilot's 4, recompute n with the updated s; a larger true s means the original plan undershoots the target margin.
- Once close to the target n, switch the final margin-of-error check to the t-distribution with df=n−1 for the precise value; at n≈246, t0.975,245≈1.970 versus z=1.96, a difference of about 0.01 in the critical value, small enough that it rarely changes the plan.
- Most product sample-size calculations stop at step 3. Two further refinements apply only in specific cases: if the population of eligible customers is small relative to n (e.g. a niche segment with only a few thousand total customers), apply a finite-population correction (a downward adjustment to n that accounts for sampling a large fraction of a small, finite population rather than an effectively infinite one), which shrinks the required sample size.
- If sampling is clustered (e.g. by region or cohort) rather than a simple random sample, inflate n by a design effect, or DEFF (a multiplier that accounts for the extra correlation between units sampled from the same cluster, which reduces how much independent information the same number of clustered units carries compared to a true simple random sample), to account for the extra correlation clustering introduces.
Trade-offs & pitfalls
- Treating the pilot-based n=246 as final rather than a planning estimate is the main risk: if the true variance is higher than the pilot suggested (common with skewed CLV data and a small pilot), the study will land with a wider-than-intended interval unless the sample size gets revisited.
- Non-response and attrition are easy to forget until data collection is already underway; inflating for expected response rate up front avoids a late scramble to recruit more.
- The margin-of-error formula assumes simple random sampling; ignoring clustering or stratification in the actual collection design while using the unadjusted formula will understate the sample size actually needed.
Explain Simpson's paradox and provide a concrete A/B testing example with hypothetical numbers where aggregating across segments yields the opposite conclusion from segment-level analysis. Describe how you would detect such paradoxes and resolve the correct interpretation for product decisions.
Sample Answer
Direct answer
Simpson's paradox is when a trend that appears in an aggregated dataset reverses, or disappears, once the data is broken into meaningful subgroups. It happens when a subgroup variable is both correlated with the outcome and unevenly distributed across the groups being compared, so the aggregate is really comparing different mixes of subgroups rather than like-for-like. In A/B testing this can flip an experiment's headline verdict if traffic composition differs between arms.
Structured elaboration
Mechanism. The paradox needs two ingredients: a segment (e.g. new vs returning users) whose baseline conversion rate differs a lot, and a segment mix that differs between the two experiment arms, whether from a randomization bug, non-random routing, or the arms genuinely attracting different user mixes (for example, if the treatment changes something only new users see first). When the high-baseline segment is overrepresented in one arm, that arm's aggregate gets pulled up regardless of the true within-segment treatment effect.
Two distinct causes worth separating. (1) A randomization or logging bug that skews segment composition between arms even though the metric itself has a uniform effect. This should be treated like Sample Ratio Mismatch: a data-quality problem to fix, not a real result to interpret. (2) A genuine, real segment-mix or heterogeneous-effect situation (e.g. the arms were deliberately targeted differently, or the treatment interacts with user tenure). This is a real result that needs segment-aware reporting, not a bug.
Worked example
Two segments with very different baseline conversion, and arms that got very different mixes of each:
| Segment | Control | Treatment |
|---|---|---|
| High-intent users | 380 / 900 = 42.2% | 45 / 100 = 45.0% |
| Low-intent users | 6 / 100 = 6.0% | 63 / 900 = 7.0% |
| Aggregate | 386 / 1,000 = 38.6% | 108 / 1,000 = 10.8% |
(All counts verified by direct computation.) Notice: treatment wins in both segments individually (45.0% > 42.2%, and 7.0% > 6.0%), but because control's traffic was mostly high-intent users (who convert well regardless of arm) and treatment's traffic was mostly low-intent users (who convert poorly regardless of arm), the aggregate makes it look like control is dramatically better. Reading only the aggregate row would lead to killing a feature that actually helped every segment it touched.
Detection. Treat segment-mix balance as a standard experiment health check alongside SRM: compare the proportion of each key segment (device, new/returning, geography) between arms, and flag if that mix itself differs significantly between arms (a chi-square test of segment distribution by arm is a direct way to check this). Separately, fit the metric with an interaction term, metric∼arm+segment+arm:segment, to see whether the treatment effect actually differs by segment (heterogeneity) as opposed to just the segment mix differing (composition).
Resolution. If the segment-mix imbalance traces back to a bug (bad routing, non-random assignment), that invalidates the experiment; the fix is to correct randomization and rerun, not to reweight around the bug. If the imbalance is real and expected (e.g. the two arms intentionally target different populations, or a feature launch changes what fraction of traffic is new users), report segment-level effects explicitly rather than a single aggregate number, and if a single summary number is still needed, use a standardized/weighted average that applies one fixed reference mix (e.g. last month's traffic composition) to both arms instead of letting each arm's own live mix drive the number.
Trade-offs & pitfalls
- Don't go looking for a favorable segment cut after seeing an unfavorable aggregate result; that's post-hoc fishing and needs the same multiple-comparisons discipline as any other exploratory subgroup analysis. Segment checks belong in the pre-registered analysis plan, run regardless of which way the aggregate goes.
- Trusting an aggregate number without ever looking at segment balance is the classic wrong turn, and it's especially dangerous because the aggregate looks perfectly clean (large N, tight CI) even while hiding a completely reversed within-segment story.
- Not every segment-level difference is Simpson's paradox; if segment mix is balanced across arms and the aggregate and segment-level conclusions agree, that's just a normal heterogeneous-effect finding, worth reporting, but not a paradox to resolve.
Explain how to test for interaction effects in a factorial experiment using regression. Provide an example with two binary treatment factors A and B, specify the regression model including interaction term, explain how to test whether the interaction is significant, and discuss how to visualize and interpret the interaction effect for stakeholders.
Sample Answer
Direct answer
Fit a regression that includes both main effects and their product term, then test whether the coefficient on the product term is significantly different from zero. That coefficient is the interaction effect: how much the effect of one factor changes depending on the level of the other. Visualize it as an interaction plot (two lines, one per level of the second factor) since non-parallel lines are the interaction made visible.
Structured elaboration
Model specification
For two binary treatments A and B (coded 0/1):
Y=β0+βAA+βBB+βAB(A×B)+ε- β0: mean outcome when A=0, B=0 (baseline).
- βA: effect of A when B=0.
- βB: effect of B when A=0.
- βAB: the interaction - the extra (or reduced) effect when both are applied together, beyond what the two main effects predict additively.
Hypothesis test
H0:βAB=0(effects are additive, no interaction) Ha:βAB=0Test with the regression's own t-statistic (t=β^AB/SE(β^AB)) or an F-test comparing the full model against the model without the interaction term. For a binary outcome, fit a logistic regression instead and test βAB on the log-odds scale with a Wald or likelihood-ratio test.
Reading the result
| Sign / magnitude of βAB | Meaning |
|---|---|
| Near 0, not significant | Effects are additive; treatments can be evaluated independently |
| Negative and significant | Sub-additive ("diminishing returns") - combining treatments helps less than the sum of parts |
| Positive and significant | Super-additive (synergy) - combining treatments helps more than the sum of parts |
Worked example
Suppose the fitted model gives β^0=10, β^A=2, β^B=3, β^AB=−4, with SE(β^AB)=1.5 from a sample of 200 users (df = 196 after estimating 4 parameters).
Predicted cell means:
| A | B | Predicted Y | Formula |
|---|---|---|---|
| 0 | 0 | 10 | β0 |
| 1 | 0 | 12 | β0+βA |
| 0 | 1 | 13 | β0+βB |
| 1 | 1 | 11 | β0+βA+βB+βAB=10+2+3−4 |
If the effects were purely additive, A=1,B=1 would predict 10+2+3=15; the observed 11 is 4 units lower, exactly βAB. Testing significance:
t=1.5−4=−2.6667,p=2(1−Ft,196(2.6667))=0.0083from scipy import stats
beta_ab, se_ab, df = -4.0, 1.5, 196
t_stat = beta_ab/se_ab # -2.6666666666666665
p_value = 2*(1 - stats.t.cdf(abs(t_stat), df)) # 0.008300776672486077
p=0.0083<0.05, so reject H0: the interaction is significant. To stakeholders: "Applying both treatments together produces 11 units, four units below what adding their separate effects would predict (p = 0.008) - the treatments partly cancel each other out."
Visualization
Plot an interaction chart: x-axis = A (0/1), two lines (B=0, B=1) tracing predicted Y with 95% CI bands. Parallel lines mean no interaction; here the B=1 line would rise less steeply from A=0 to A=1 than the B=0 line, visually showing the −4 unit drag.
Trade-offs & pitfalls
- Power for interactions is much lower than for main effects. Detecting an interaction of the same magnitude as a main effect typically needs roughly four times the sample size, because the interaction estimate is a difference of differences. Plan sample size around the interaction, not the main effects, if the interaction is the thing you actually care about.
- Coding scheme matters for main effects, not for the interaction test. Using 0/1 dummy coding versus effects coding (-1/+1) changes what βA and βB mean, but the test on βAB and its p-value are unaffected.
- Higher-order interactions get hard to power and interpret fast. With more than two factors, three-way and higher interactions are rarely well-powered in typical product experiments; only pursue them with a specific hypothesis and adequate sample size.
- Don't eyeball non-parallel lines as proof. Always accompany the interaction plot with the CI on βAB (or the plotted lines' error bands) - visually non-parallel lines can be noise at small sample sizes.
Technical coding (Python): Implement a function that computes a two-sided z-test p-value for comparing two proportions. Signature: def proportion_ztest(success_a, n_a, success_b, n_b) -> float. State assumptions in a docstring and handle edge cases such as zero trials. (You may use math or scipy in your answer; explain if you assume scipy is available.)
Sample Answer
Approach
Comparing two proportions under H0:pa=pb uses a pooled-proportion z-test. Estimate the pooled proportion across both groups, use it to compute the standard error under the null, form the z-statistic from the observed difference, and convert to a two-sided p-value using the standard normal CDF:
p^=na+nbxa+xb,z=p^(1−p^)(na1+nb1)p^a−p^b,p-value=2(1−Φ(∣z∣))def proportion_ztest(success_a, n_a, success_b, n_b) -> float:
"""
Two-sided z-test p-value for a difference in two proportions (pooled variance).
Assumptions:
- Two independent samples of Bernoulli trials.
- Large-sample normal approximation holds (rule of thumb: n*p and n*(1-p) >= 5
in each group under the pooled proportion).
- H0: p_a == p_b (two-sided alternative).
Edge cases:
- Raises ValueError if n_a or n_b <= 0, or if success counts are out of range.
- If the pooled variance is 0 (e.g. success_a == n_a and success_b == n_b, both
groups all-success), returns p=1.0 when proportions are equal, else 0.0.
"""
import math
for name, v in (("success_a", success_a), ("n_a", n_a), ("success_b", success_b), ("n_b", n_b)):
if not isinstance(v, (int, float)):
raise TypeError(f"{name} must be numeric")
if n_a <= 0 or n_b <= 0:
raise ValueError("n_a and n_b must be > 0")
if not (0 <= success_a <= n_a) or not (0 <= success_b <= n_b):
raise ValueError("success counts must be between 0 and their respective n")
p_a = success_a / n_a
p_b = success_b / n_b
pooled_p = (success_a + success_b) / (n_a + n_b)
var = pooled_p * (1 - pooled_p) * (1 / n_a + 1 / n_b)
if var == 0:
return 1.0 if p_a == p_b else 0.0
z = (p_a - p_b) / math.sqrt(var)
def std_norm_cdf(x):
return 0.5 * (1 + math.erf(x / math.sqrt(2)))
p_value = 2 * (1 - std_norm_cdf(abs(z)))
return float(min(max(p_value, 0.0), 1.0))
Key points
- Uses
math.erffor the normal CDF, so the function has zero third-party dependencies; if scipy is available,scipy.stats.norm.cdfis a drop-in swap forstd_norm_cdf. - Pools the two sample proportions under the null (rather than using each group's own variance) because that's the correct variance estimate for a test of equality; a confidence interval on the difference, by contrast, should use the unpooled variance.
- Validates types and ranges up front so a bad call fails loudly rather than silently returning a nonsense p-value.
Complexity
O(1) time and space: every operation is a fixed number of arithmetic operations regardless of na or nb (the counts, not the raw data, are the inputs).
Edge cases
n_aorn_bequal to 0 raisesValueErrorrather than dividing by zero.- Success counts outside
[0, n]raiseValueError. - Both groups at 100% success (
var == 0, no variability to test): returns1.0if the proportions are equal,0.0if the sample sizes differ in a way that still leaves the proportions equal (this only occurs at the boundary and both proportions are identically 1.0, so it always returns1.0in practice for this branch). - Very small
n_a/n_bwheren*p < 5: the function still returns a number, but the normal approximation is unreliable there; a docstring note (and, in production, a runtime warning) flags that Fisher's exact test is the safer choice for small samples.
Verified with a pinned worked example: success_a=1240, n_a=20000 (6.20% conversion) vs. success_b=1360, n_b=20000 (6.80% conversion) gives pooled_p=0.0650, z=-2.4338, p-value = 0.0149, which matches scipy.stats.norm.cdf-based computation to within 1e-9 when cross-checked.
You have an experiment with 20 variants but sparse traffic per variant. Propose a Bayesian hierarchical model to estimate variant effects that borrows strength across variants. Explain the hierarchical structure, choice of priors to provide useful shrinkage, inference methods you might use (full MCMC vs variational inference), and how you would translate posterior summaries into business decisions about which variants to promote.
Sample Answer
Direct answer
With 20 variants and thin traffic per variant, treat each variant's true conversion rate as drawn from a shared population distribution rather than estimating each one in isolation. This is exactly what partial pooling buys you: variants with little data get pulled, or shrunk, toward the overall pattern, while variants with lots of data are barely adjusted, which is the right behavior since a noisy 30-visitor variant genuinely deserves less trust than its raw sample rate suggests.
Structured elaboration
Hierarchical structure
Model conversions per variant j as binomial, and let the variant-level logit rate be drawn from a shared normal population:
yj∼Binomial(nj,pj),logit(pj)=θj θj∼Normal(μ,τ2)The logit link keeps p_j inside (0,1) and makes the population-level normal assumption reasonable, since rates are bounded but logits are not. Mu is the population's central log-odds of conversion, tau squared is how much true variants genuinely differ from each other; the hierarchy is what lets information flow between variants without forcing them to be identical.
Priors and shrinkage
μ∼Normal(0,5),τ∼HalfNormal(2)weakly informative on the population mean, and a half-normal on tau, not tau squared directly, since HMC samplers behave better on the standard-deviation scale, that lets the data decide how much pooling is warranted. If tau's posterior concentrates near 0, the model has effectively decided the variants aren't really different and pools hard; if tau's posterior is large, it pools lightly and lets each variant's own data dominate. This mechanism avoids two failure modes at once: treating 20 independent noisy point estimates as fully reliable (no pooling), and assuming all variants secretly share one rate (complete pooling).
Inference: MCMC versus variational inference
The core idea, partial pooling through a hierarchical model, is the interview-relevant answer on its own; the choice between MCMC and variational inference below is an implementation detail worth naming briefly, not something to derive from scratch unless the interviewer asks to go deeper. Two families of algorithms fit this kind of model: full MCMC methods (NUTS, the No-U-Turn Sampler, and HMC, Hamiltonian Monte Carlo, which explore the posterior by simulating physics-like trajectories rather than pure random-walk steps, and are the modern default in Stan, PyMC, and NumPyro) and variational inference (which instead fits a simpler, tractable distribution to approximate the true posterior, trading some accuracy for speed).
| Full MCMC (NUTS/HMC) | Variational inference (mean-field ADVI) | |
|---|---|---|
| Posterior accuracy | Asymptotically exact | Approximate; commonly underestimates posterior variance |
| Cost | Higher, but 20 variants is small enough this rarely matters | Faster, matters more at hundreds or thousands of groups, or streaming updates |
| When to use | Default choice at this scale; a business decision needs honest uncertainty | Only with a genuine latency or scale requirement mean-field VI is needed to satisfy |
At 20 variants there's rarely a good reason to reach for VI: run NUTS (Stan, PyMC, or NumPyro), check that R-hat (a convergence diagnostic comparing the variance between independent chains to the variance within each chain; values close to 1.00 mean the chains agree and have converged) is close to 1 and that effective sample size is adequate, and use the full posterior. VI becomes the pragmatic choice once there are hundreds or thousands of variants or campaigns updating continuously and re-running MCMC on every batch is the actual bottleneck, and even then, validate the VI posterior against a NUTS run on a representative subset before trusting it in production.
Turning posteriors into decisions
- Report the posterior mean or median and a 90% or 95% credible interval per variant, not just a point estimate. (Unlike a frequentist confidence interval, a Bayesian credible interval is a direct probability statement about the parameter itself, given the model and the priors used, for example 'there is a 95% probability the true rate lies in this range'.)
- For a promote-or-kill decision, compute the fraction of posterior draws where variant j beats the control directly from the posterior samples; this is more decision-relevant than a p-value and comes for free once you have the posterior.
- Set a pre-agreed decision rule, for example "promote if that probability exceeds 0.95 and the expected lift clears a minimum practical threshold", before looking at results, the same discipline a frequentist pre-registration would require.
Worked example
Empirical-Bayes analytic shrinkage on 5 of the 20 variants, computed exactly with no sampling required, to illustrate the mechanism a full hierarchical fit would also produce.
| Variant | n | conversions | raw rate |
|---|---|---|---|
| V1 | 40 | 6 | 0.1500 |
| V2 | 35 | 3 | 0.0857 |
| V3 | 50 | 11 | 0.2200 |
| V4 | 30 | 2 | 0.0667 |
| V5 | 45 | 9 | 0.2000 |
Working on the logit scale with the delta-method sampling variance (a standard approximation for the variance of an estimated rate, obtained by treating the sampling error as approximately linear near the observed value)
σj2=njp^j(1−p^j)1the DerSimonian-Laird estimator (a standard method-of-moments formula from meta-analysis for estimating the between-group variance tau-squared; it is the closed-form point-estimate special case of the same normal-normal hierarchy used above) gives tau-hat-squared = 0.0526 for this data, and the precision-weighted grand mean is mu-hat = -1.6547 on the logit scale (logistic(-1.6547) is approximately 0.160).
(verified with statsmodels.stats.meta_analysis.combine_effects(theta, sigma2, method_re='dl'), which independently returns tau2=0.05261 and random-effect mean=-1.65474, matching a manual recomputation of the formula exactly)
The resulting shrinkage weight for variant j is B_j = sigma_j^2 / (sigma_j^2 + tau-hat-squared), how much weight goes to the population mean versus the variant's own data:
| Variant | shrinkage weight B_j | raw rate | shrunk rate |
|---|---|---|---|
| V1 | 0.788 | 0.1500 | 0.1582 |
| V2 | 0.874 | 0.0857 | 0.1487 |
| V3 | 0.689 | 0.2200 | 0.1774 |
| V4 | 0.911 | 0.0667 | 0.1490 |
| V5 | 0.725 | 0.2000 | 0.1707 |
V4 has the smallest n (30) and the most extreme raw rate (0.0667), so it gets the heaviest shrinkage weight (0.911) and moves the most, from 0.0667 to 0.1490, more than doubling its estimated rate toward the population pattern. V3, with the largest sample (50) and a rate closer to the pool average, has the lightest shrinkage weight (0.689) and moves the least (0.2200 to 0.1774). A full hierarchical model fit with MCMC would produce this same qualitative behavior, since this empirical-Bayes calculation is the closed-form point-estimate special case of the same normal-normal hierarchy, but the full Bayesian model additionally gives a proper credible interval per variant that reflects both sigma_j squared and the uncertainty in tau squared itself, which this plug-in calculation understates.
Applying the promote/kill rule to these five variants. The rule above needs an actual comparison point. Assume, for this demonstration, a control experience with a known historical rate of 15% (logit(0.15) = -1.7346), precise enough from a large, long-running control bucket that its own sampling uncertainty can be treated as negligible next to the variant-level uncertainty computed above. Each variant's posterior on the logit scale is approximately Normal with mean equal to its shrunk logit estimate and variance
Vj=Bjτ^2(the same harmonic combination of sigma_j squared and tau-hat-squared that produced the shrinkage weights). That gives a z-score and an approximate P(variant beats control) for each variant, which the promote rule stated above (promote if that probability exceeds 0.95 and the shrunk lift clears a minimum practical threshold, set here at +2 percentage points) can actually be applied to:
| Variant | shrunk rate | posterior SE (logit) | shrunk lift vs. 15% control | P(beats control) | Decision |
|---|---|---|---|---|---|
| V1 | 0.1582 | 0.204 | +0.82pp | 0.621 | Hold: lift is small and P is far below 0.95 |
| V2 | 0.1487 | 0.214 | -0.13pp | 0.481 | Hold: lift is negative |
| V3 | 0.1774 | 0.190 | +2.74pp | 0.854 | Hold: closest to promotion, lift clears +2pp, but P still short of the 0.95 bar |
| V4 | 0.1490 | 0.219 | -0.10pp | 0.485 | Hold: lift is negative |
| V5 | 0.1707 | 0.195 | +2.07pp | 0.784 | Hold: lift clears +2pp but P still short of the 0.95 bar |
(P(beats control) computed as the standard normal CDF of (shrunk logit minus logit(0.15)) divided by the posterior SE; verified with python3's math.erf.)
Applying the stated rule to all five produces the same verdict for every one of them: hold, not enough evidence yet, rather than a mixed promote/kill split. V3 comes closest, with an 85.4% chance of beating the assumed control and a shrunk lift (+2.74pp) that clears the practical-significance bar, but it still falls about 10 points short of the 95% probability threshold. That is exactly the behavior the rule is supposed to produce at this sample size: with only 30 to 50 observations per variant even after partial pooling, the evidence for any single variant beating control is real but not yet strong enough to act on, so the rule correctly withholds a promotion rather than manufacturing false confidence from a noisy point estimate. A variant would only clear the bar here with either a much larger raw sample (shrinking its posterior SE) or a much larger true effect than any of these five show.
Trade-offs and pitfalls
- This worked calculation plugs in a point estimate of tau squared and treats it as known; a full Bayesian fit propagates uncertainty in tau squared into every variant's credible interval, which is wider, and more honest, than the empirical-Bayes interval from treating tau-hat-squared as fixed.
- Over-pooling is a real risk if variants are genuinely different for a business reason, for example one variant targeting a different audience segment. The model can't distinguish "genuinely different" from "noisy" on its own; domain judgment about which variants belong in the same hierarchy still matters.
- Mean-field VI's most common failure mode here is understating tau's posterior uncertainty, which then understates how much variants should be pooled. Don't trust a VI-only promotion decision without spot-checking against MCMC on a few variants.
- A common wrong turn: running 20 independent tests with FDR correction instead of a hierarchical model. FDR correction on independent tests controls false discoveries but doesn't improve the estimates themselves, so small-n variants keep their noisy point estimates. Partial pooling actually improves the point estimates, the better fix when the real problem is that individual estimates are unreliable, not simply that too many tests are being run.
Unlock Full Question Bank
Get access to all Statistical Inference and Hypothesis Testing interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.