← Google Interview Insights

Google·Data Scientist·Technical Phone Screen·Senior

Senior
Jul 2026

Summary

Heavy stats interview at Google for a DS role. The whole thing was basically one long question about what happens when you duplicate your dataset, and it went deeper than I expected into chi-square tests and Bayesian remedies by the end.

Questions Asked (4)

Q1

If you duplicate your entire dataset k times and refit OLS, prove algebraically that the coefficient estimates stay the same but the standard errors shrink by 1/sqrt(k). Then walk through the downstream effects on t-statistics, p-values, and confidence interval widths.

A/B Testing & ExperimentationTechnical Trade-offs
Author's notes

I knew the punchline intuitively but fumbled the algebra mid-explanation.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, set up the algebra by writing the OLS estimator for the duplicated dataset and show that the coefficients are unchanged because the normal equations scale identically. Then derive the variance of the estimator, showing it is divided by k, so standard errors shrink by 1/√k. Finally, explain the downstream effects: t-statistics inflate by √k, p-values decrease, and confidence intervals narrow, but emphasize that this is an artifact of artificially inflating sample size without new information.

Pro tip: Connect this to real-world implications: duplicating data is like p-hacking because it artificially shrinks standard errors and inflates significance without adding information. Mention that in practice, you should never duplicate data to boost significance; instead, focus on collecting more data or using proper statistical methods.

1. Set up the OLS estimator for duplicated data

Write the OLS estimator β̂ = (XᵀX)⁻¹Xᵀy for the original data. For the duplicated dataset, the design matrix becomes X_dup = [X; X; ...; X] (k times) and similarly for y. Show that X_dupᵀX_dup = k XᵀX and X_dupᵀy_dup = k Xᵀy, so β̂_dup = (k XᵀX)⁻¹ (k Xᵀy) = β̂.

2. Derive the variance of the duplicated estimator

Under the Gauss-Markov assumptions, Var(β̂) = σ² (XᵀX)⁻¹. For the duplicated data, Var(β̂_dup) = σ² (X_dupᵀX_dup)⁻¹ = σ² (k XᵀX)⁻¹ = (1/k) σ² (XᵀX)⁻¹ = (1/k) Var(β̂). Thus, standard errors are scaled by 1/√k.

3. Explain the impact on t-statistics and p-values

The t-statistic for a coefficient is β̂_j / SE(β̂_j). Since β̂_j is unchanged and SE(β̂_j) is divided by √k, the t-statistic is multiplied by √k. Consequently, p-values decrease (become more significant) because the t-distribution with more degrees of freedom (since n increases) and larger t-statistic yields smaller tail probabilities.

4. Discuss confidence interval widths

A confidence interval for β_j is β̂_j ± t_{α/2, df} * SE(β̂_j). The standard error shrinks by 1/√k, and the critical value t_{α/2, df} also changes slightly due to increased degrees of freedom (df = k*n - p). However, for large n, the critical value is approximately unchanged, so the interval width shrinks roughly by 1/√k.

5. Summarize implications and caveats

Conclude that duplicating data artificially inflates significance without adding new information, leading to overconfidence in estimates. This is a form of data leakage or p-hacking. In practice, one should not duplicate data; instead, collect more data or use appropriate methods like bootstrapping or regularization.

Key Points to Mention

  • OLS estimator formula: β̂ = (XᵀX)⁻¹Xᵀy
  • Scaling of normal equations: X_dupᵀX_dup = k XᵀX and X_dupᵀy_dup = k Xᵀy
  • Variance of OLS estimator: Var(β̂) = σ² (XᵀX)⁻¹
  • Standard errors shrink by 1/√k, t-statistics inflate by √k
  • p-values decrease and confidence intervals narrow
  • Degrees of freedom increase, affecting t-distribution critical values
  • This is a statistical artifact and should not be done in practice

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

Q2

Concretely: if the original SE for a coefficient is 0.20 and t is 5.0, and you incorrectly treat 4 duplicates as independent observations, what are the new SE, t-statistic, and approximate two-sided p-value? Show your work.

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

This part I actually liked.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, recognize that the original t-statistic is 5.0 = β/0.20, so β = 1.0. Then, treating 4 duplicates as independent inflates the sample size by a factor of 4, which incorrectly reduces the standard error by sqrt(4) = 2, giving a new SE of 0.10. Finally, compute the new t-statistic as 1.0/0.10 = 10.0 and find the two-sided p-value for t=10 with the (incorrectly) inflated degrees of freedom, which is approximately <0.0001 (or 2e-23 for large df).

Pro tip: Emphasize that this mistake artificially inflates significance by ignoring the correlation among duplicates, leading to false positives. Always check for and account for clustering or repeated measures in A/B tests.

1. Extract the coefficient estimate

Use the given original SE and t-statistic to back out the coefficient: β = t * SE = 5.0 * 0.20 = 1.0.

2. Determine the incorrect sample size inflation

Treating 4 duplicates as independent multiplies the effective sample size by 4, so the standard error is scaled by 1/sqrt(4) = 1/2.

3. Compute the new standard error

New SE = original SE / sqrt(4) = 0.20 / 2 = 0.10.

4. Compute the new t-statistic

New t = β / new SE = 1.0 / 0.10 = 10.0.

5. Find the approximate two-sided p-value

For t=10 with large degrees of freedom (due to inflated n), the two-sided p-value is extremely small, roughly <0.0001 (e.g., 2e-23). Use a t-distribution or normal approximation.

Key Points to Mention

  • The relationship between standard error and sample size: SE ∝ 1/√n.
  • The t-statistic formula: t = coefficient / SE.
  • The impact of violating independence on standard errors and p-values.
  • The concept of effective sample size and design effect in clustered data.
  • The importance of accounting for repeated measures or duplicates in A/B testing.
  • How to compute a two-sided p-value from a t-statistic (using t-distribution or normal approximation for large df).

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

Q3

What does a p-value actually mean, and why does dataset duplication break its assumptions? Give examples of real analyst workflows like oversampling, data augmentation, or bootstrapping that can accidentally produce the same problem.

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

Tripped up a bit connecting bootstrapping to this.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining a p-value precisely as the probability of observing data at least as extreme as the observed, assuming the null hypothesis is true. Then explain that its validity hinges on independent observations, and show how duplication violates this by artificially inflating the effective sample size and shrinking standard errors. Finally, connect to real analyst workflows where duplication can occur unintentionally, such as oversampling, data augmentation, and bootstrapping, and suggest ways to detect and avoid the issue.

Pro tip: Emphasize that p-values are not probabilities of the null hypothesis being true, and that duplication can make p-values artificially small even when there is no real effect. Mention that techniques like bootstrapping are valid for inference but require careful handling to avoid treating resampled data as independent new observations.

1. Define p-value correctly

State that a p-value is the probability, under the null hypothesis, of obtaining a test statistic at least as extreme as the one observed. Clarify that it is not the probability that the null hypothesis is true.

2. Explain assumptions for validity

Highlight that p-values rely on assumptions like independence of observations and correct specification of the null model. Violating independence, e.g., through duplication, invalidates the null distribution and leads to misleading p-values.

3. Describe how duplication breaks assumptions

Explain that duplicating data points makes observations non-independent, artificially increases the sample size, and underestimates variance. This inflates test statistics and produces p-values that are too small, increasing false positive rates.

4. Connect to real analyst workflows

Give examples: oversampling minority classes in classification can duplicate rows; data augmentation in ML creates near-duplicates; bootstrapping resamples with replacement, and if treated as new independent data, it can mimic duplication. Discuss how each can accidentally lead to the same problem if not handled properly.

5. Suggest mitigation and best practices

Recommend using methods that account for non-independence, such as mixed-effects models, or adjusting sample size calculations. For bootstrapping, emphasize that it is a resampling technique for estimating variability, not for increasing sample size. Always check for duplicates and consider the effective sample size.

Key Points to Mention

  • P-value definition: probability of observing data at least as extreme under the null hypothesis.
  • Independence assumption: observations must be independent for standard tests to be valid.
  • Duplication effect: artificially increases sample size, reduces variance, inflates test statistics, and yields anti-conservative p-values.
  • Oversampling: duplicating minority class instances can lead to overfitting and invalid statistical inference if not corrected.
  • Data augmentation: creating synthetic near-duplicates can violate independence if treated as new independent samples.
  • Bootstrapping: resampling with replacement creates dependent samples; p-values from bootstrap should be computed appropriately (e.g., via permutation or bootstrap confidence intervals).

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

Q4

With chi-square tests, very large samples can produce tiny p-values for effects that are practically meaningless. How would you address this? Discuss reporting an effect size like Cramér's V or an odds ratio with a confidence interval, and also a penalized or Bayesian approach. When is each preferable?

A/B Testing & ExperimentationTechnical Trade-offsProduct Analytics & Metrics
Author's notes

This pivot to chi-square caught me off guard after the OLS thread.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Acknowledge the sample size issue and emphasize that statistical significance does not imply practical significance. Then discuss effect size measures like Cramér's V and odds ratios with confidence intervals to quantify the magnitude and uncertainty of the effect. Finally, compare and contrast penalized (e.g., ridge) and Bayesian approaches, explaining when each is preferable based on the goal (e.g., prediction vs. inference) and context (e.g., prior information availability).

Pro tip: Frame the answer around decision-making: the goal is not just to detect an effect but to decide if it's large enough to matter for the business. Mention that at Google, you'd often combine effect sizes with confidence intervals and consider the cost-benefit trade-off.

1. Acknowledge the problem

Explain that with large samples, chi-square tests can detect trivial deviations from the null, leading to tiny p-values that are not practically meaningful.

2. Report effect sizes with confidence intervals

Discuss Cramér's V for categorical association and odds ratios for 2x2 tables, including confidence intervals to convey precision and practical significance.

3. Consider penalized or Bayesian methods

Describe how penalized methods (e.g., ridge regression) shrink estimates to avoid overfitting, and Bayesian methods incorporate priors to regularize and provide credible intervals.

4. Compare and choose appropriately

Explain when each is preferable: effect sizes for communication and practical significance; penalized methods for prediction with many predictors; Bayesian for incorporating prior knowledge and quantifying uncertainty.

Key Points to Mention

  • Cramér's V as a measure of association for contingency tables, ranging from 0 to 1.
  • Odds ratio for 2x2 tables, with confidence intervals to assess precision.
  • Penalized methods like ridge or lasso regression that shrink coefficients.
  • Bayesian approaches with priors and credible intervals.
  • The distinction between statistical and practical significance.
  • Context-dependence: effect sizes for reporting, penalized/Bayesian for modeling.

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