← LinkedIn Interview Insights

LinkedIn·Data Scientist·Technical Phone Screen·Senior

SeniorPrefer not to say
May 2026Remote

Summary

LinkedIn data scientist interview with a meaty stratified A/B testing problem. The whole session was basically one long question that kept branching into follow-ups about Simpson's paradox and Mantel-Haenszel, which I was not fully prepared for.

Questions Asked (5)

Q1

You ran a stratified email A/B test across two weeks and two cities. Compute stratum-specific conversion rates and 95% confidence intervals for each variant in each stratum.

A/B Testing & ExperimentationProduct Analytics & Metrics
Author's notes

This part felt manageable.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the data structure and definitions: identify the strata (city × week), the variants, and the conversion metric. Then, for each stratum and variant, compute the conversion rate as conversions/visitors, and calculate the 95% confidence interval using the normal approximation (or Wilson score) for a proportion. Finally, present the results in a clear table and discuss any notable patterns or caveats.

Pro tip: Always check the sample size and conversion counts per stratum; if counts are small, use the Wilson interval or exact methods instead of the normal approximation, and mention that you would consider multiple testing corrections if making comparisons across many strata.

1. Clarify the data and definitions

Confirm the strata (e.g., City A Week 1, City A Week 2, City B Week 1, City B Week 2), the variants (control and treatment), and the conversion metric (e.g., click-through rate, sign-up rate). Ensure you know the numerator (conversions) and denominator (visitors or users) for each cell.

2. Compute stratum-specific conversion rates

For each stratum and variant, calculate the conversion rate as the number of conversions divided by the number of visitors. Present these rates clearly, perhaps in a table.

3. Calculate 95% confidence intervals

For each rate, compute the standard error using sqrt(p*(1-p)/n) and the 95% CI as p ± 1.96*SE. If sample sizes are small or rates extreme, use the Wilson score interval for better coverage.

4. Interpret and present results

Summarize the rates and CIs, noting any overlapping intervals or significant differences. Discuss whether the stratified analysis reveals consistent effects across cities and weeks, and mention any limitations (e.g., multiple comparisons, small sample sizes).

Key Points to Mention

  • Definition of strata: city and week combinations (e.g., City A Week 1, City A Week 2, etc.)
  • Conversion rate formula: conversions / visitors
  • 95% confidence interval formula for a proportion: p ± 1.96 * sqrt(p*(1-p)/n)
  • Assumption of independence and large sample size for normal approximation
  • Alternative methods like Wilson score interval for small samples or extreme proportions
  • Consideration of multiple testing when comparing many strata

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Use a Mantel-Haenszel estimate to test for a common treatment effect across strata. Report the common odds ratio, its 95% CI, and the two-sided p-value.

A/B Testing & ExperimentationProduct Analytics & Metrics
Author's notes

This is where I started sweating a little.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, explain that the Mantel-Haenszel test assesses whether the treatment effect is consistent across strata by estimating a common odds ratio. Then, outline the steps to compute the MH odds ratio, its confidence interval, and the p-value, emphasizing the assumptions and interpretation in the context of A/B testing.

Pro tip: Mention that the MH test is most appropriate when strata are not too sparse and the treatment effect is expected to be homogeneous; otherwise, consider a test for interaction or a random-effects model.

1. Understand the purpose and assumptions

Explain that the Mantel-Haenszel test estimates a common odds ratio across strata, assuming a consistent treatment effect. Discuss when to use it, such as when analyzing A/B test results across different user segments.

2. Compute the Mantel-Haenszel odds ratio

Describe the formula for the MH odds ratio: sum of (a_i * d_i / n_i) divided by sum of (b_i * c_i / n_i), where a_i, b_i, c_i, d_i are the cell counts in each 2x2 table for stratum i.

3. Calculate the 95% confidence interval

Use the standard error of the log odds ratio: sqrt( sum of ( (a_i+d_i)/n_i^2 * (a_i*d_i) + (b_i+c_i)/n_i^2 * (b_i*c_i) ) ) or the Robins-Breslow-Greenland variance estimator. Then compute the CI as exp(log(OR_MH) ± 1.96 * SE).

4. Compute the two-sided p-value

Perform the Mantel-Haenszel chi-square test: sum of (a_i - E[a_i]) / sqrt(sum of Var[a_i]), where E[a_i] = (a_i+b_i)(a_i+c_i)/n_i and Var[a_i] = (a_i+b_i)(c_i+d_i)(a_i+c_i)(b_i+d_i)/(n_i^2 (n_i-1)). Square the statistic and compare to a chi-square distribution with 1 degree of freedom.

5. Interpret results in context

Report the common odds ratio, its 95% CI, and p-value. Discuss whether the treatment effect is statistically significant and consistent across strata, and relate to business impact.

Key Points to Mention

  • Mantel-Haenszel test is used for stratified analysis to control for confounding variables.
  • The common odds ratio assumes homogeneity of treatment effect across strata; test for interaction if this is violated.
  • The MH odds ratio is a weighted average of stratum-specific odds ratios, with weights proportional to the inverse variance.
  • Confidence interval calculation often uses the Robins-Breslow-Greenland variance estimator for robustness.
  • The p-value from the MH chi-square test assesses whether the common odds ratio is significantly different from 1.
  • In A/B testing, stratification can improve power by accounting for known covariates like user demographics or pre-experiment behavior.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

Test for effect heterogeneity across strata using a Breslow-Day test or equivalent interaction test. What does the result tell you?

A/B Testing & Experimentation
Author's notes

I blanked on the Breslow-Day formula specifically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining that the Breslow-Day test (or an equivalent interaction test) checks whether the treatment effect is consistent across different strata or subgroups. Then describe what a significant result means: there is evidence of effect heterogeneity, meaning the treatment effect varies by subgroup. Finally, discuss the implications for decision-making, such as the need for further investigation or tailored strategies.

Pro tip: Emphasize that a non-significant result does not prove homogeneity; it may simply lack power to detect interactions, especially with small sample sizes per stratum. Always consider practical significance and the context of the experiment.

1. Define the purpose of the test

Explain that the Breslow-Day test assesses whether the odds ratio (or treatment effect) is homogeneous across strata. It is an interaction test between treatment and subgroup.

2. Interpret the null and alternative hypotheses

State that the null hypothesis is that the treatment effect is the same across all strata (no interaction), while the alternative is that at least one stratum has a different effect.

3. Explain the result

If the test is significant (p < alpha), there is evidence of effect heterogeneity; the treatment effect differs by subgroup. If not significant, there is insufficient evidence to conclude heterogeneity.

4. Discuss implications and next steps

A significant result suggests the overall effect may not be generalizable; investigate which subgroups drive the difference and consider whether to tailor interventions or run further experiments.

5. Acknowledge limitations

Mention that the test has assumptions (e.g., large sample sizes) and that multiple testing can inflate false positives; adjust for multiple comparisons if needed.

Key Points to Mention

  • Breslow-Day test is used for testing homogeneity of odds ratios across strata in a 2x2 table setting.
  • Equivalent interaction tests include logistic regression with treatment-by-subgroup interaction terms.
  • A significant result indicates effect heterogeneity, meaning the treatment effect varies by subgroup.
  • A non-significant result does not confirm homogeneity; it may be due to low power.
  • Effect heterogeneity has implications for personalization, targeting, and generalizability of results.
  • Consider multiple comparisons and pre-registration of subgroups to avoid false discoveries.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

Compute the naive pooled conversion rates ignoring stratification. Does Simpson's paradox appear here, and why?

A/B Testing & ExperimentationRoot Cause Analysis
Author's notes

Yes, Simpson's paradox shows up.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, compute the overall conversion rates by pooling all users across strata, ignoring any segmentation. Then, compare the pooled rates to the stratum-specific rates to check if the direction of the effect reverses, which would indicate Simpson's paradox. Explain the paradox by highlighting how confounding variables (like device type or user activity) can distort the pooled comparison.

Pro tip: Always consider whether the strata are balanced between treatment and control; if not, the pooled analysis can be misleading. Mention that Simpson's paradox is a sign of confounding and that stratified analysis or regression adjustment is needed for valid inference.

1. Compute pooled conversion rates

Aggregate the data across all strata to calculate the overall conversion rate for each variant (e.g., control and treatment). This gives the naive pooled rates.

2. Compute stratum-specific rates

Calculate conversion rates within each stratum (e.g., by device, region, or user segment) for both variants to understand the effect within homogeneous groups.

3. Compare pooled vs. stratified results

Check if the direction of the difference between variants reverses when moving from pooled to stratified analysis. If it does, Simpson's paradox is present.

4. Identify confounding and imbalance

Examine whether the distribution of strata differs between variants. If one variant has more users in a stratum with inherently higher conversion, it can distort the pooled rate.

5. Explain implications and next steps

Discuss why Simpson's paradox matters for decision-making and recommend using stratified analysis, regression, or propensity scores to adjust for confounders.

Key Points to Mention

  • Definition of Simpson's paradox: a trend appears in groups but disappears or reverses when groups are combined.
  • Importance of stratification in A/B testing to control for confounding variables.
  • How imbalance in stratum sizes between treatment and control can cause the paradox.
  • The need to check for interactions between treatment and strata.
  • Use of weighted averages or standardization to compute adjusted rates.
  • Real-world implications: misleading conclusions if pooled analysis is used without checking for paradox.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q5

Make a final recommendation: which email variant should you go with, and how do you reconcile the stratified analysis with the naive pooled result?

A/B Testing & ExperimentationProduct Strategy
Author's notes

Go with B.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly stating your final recommendation based on the stratified analysis, then explain why the naive pooled result is misleading due to confounding or Simpson's paradox. Reconcile the two by discussing the importance of controlling for key covariates and the validity of stratified results for decision-making.

Pro tip: Always check for Simpson's paradox by examining segment-level results; it's a common pitfall in A/B testing that can lead to wrong decisions. Mention that you would validate the stratified findings with a regression model or interaction tests to ensure robustness.

1. State your recommendation

Begin with a clear, decisive recommendation on which email variant to choose, based on the stratified analysis. For example, 'I recommend variant B because it performs better within key user segments.'

2. Explain the discrepancy

Describe why the naive pooled result differs from the stratified result, likely due to confounding variables or Simpson's paradox. Highlight that the pooled analysis may be biased by unequal distribution of segments across variants.

3. Justify the stratified approach

Argue that the stratified analysis is more reliable because it controls for important covariates, providing a truer estimate of the treatment effect within relevant subpopulations.

4. Address potential concerns

Acknowledge limitations such as multiple testing or reduced power in strata, and suggest validation methods like regression adjustment or interaction tests to confirm findings.

5. Conclude with business impact

Tie the recommendation back to business goals, explaining how the chosen variant will improve key metrics and why the stratified insight is actionable for LinkedIn.

Key Points to Mention

  • Simpson's paradox and confounding variables
  • Stratified analysis controls for segment-level differences
  • Naive pooled result can be biased due to unequal segment distribution
  • Importance of pre-registering segments and avoiding p-hacking
  • Use of regression models or interaction terms to validate stratified findings
  • Business implications: targeting specific user segments for better engagement

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.