Google data scientist interview preparation becomes more useful when you connect a statistical method to a decision. Knowing the regression formula is one step. Explaining why a duplicated join makes an interval look narrower, and why a positive estimate still falls short of a launch rule, requires more care.
This guide separates analytics, experimentation and research preparation, then develops one complete numerical case. The dataset, implementation and product rule are original teaching material. They are not Google internal data, an official interview rubric or a claim about a private question being asked.
![]()
Start with the job’s actual emphasis
Use the following routes to choose what to rehearse. These are preparation categories, not three fixed Google interview processes. Read the posting for your role, identify the work you would own and confirm the interview agenda with your recruiter.
| Study route | Main problem to practice | Evidence to produce |
|---|---|---|
| Product analytics | Explain a product movement without confusing logging, mix and behavior | Metric contract, checked query, segmented diagnosis |
| Experimentation | Estimate an intervention’s effect and make a decision under uncertainty | Assignment design, valid analysis, practical threshold |
| Research or modeling | Investigate a method and test whether it generalizes | Baseline, assumptions, holdout design, error analysis |
All three benefit from coding, statistical reasoning and clear communication. Adjust the balance to the specific role instead of assuming that every data scientist interview is mostly SQL, mostly algorithms or mostly model theory. Degree requirements also belong to the actual posting.
The public sources reviewed here do not establish one universal Google DS round count or duration. Confirm the assessment format, permitted languages, collaborative tools and session timing. Google’s virtual-interview candidate guide describes setup and conduct: test your equipment, use the confirmed tools, keep interview materials confidential and contact your recruiting coordinator when technical problems interfere.
That guide also explicitly prohibits AI assistance during the interview and submitting work you did not produce. Practice until you can explain the analysis independently; ask your recruiter about approved tools and any accommodation needs.
A useful statistics prompt: duplicate observations
PracHub’s Analyze Linear Regression Changes with Duplicated Observations asks about coefficients, standard errors, p-values and large-sample chi-square interpretation. The worked case below resolves those issues through an experiment analysis rather than a list of definitions.
Original case. A hypothetical productivity product tests a new task-completion interface. Randomize 2,000 independent users equally between control and treatment. Count completed tasks per assigned user over a fixed 14-day period, including zero for genuinely observed non-completion. A known missing logging window is not a zero.
Record each user’s completed tasks from the preceding 14 days as a baseline covariate. Before seeing outcomes, choose a linear adjustment using treatment and that baseline. The estimand is the average change in completed tasks per assigned user under this experiment’s conditions, not the effect among only users who opened the new interface.
Declare the decision rule in advance: the lower end of the approximate 95% interval must exceed 0.20 additional tasks per user, and separately specified safety and reliability checks must pass. The threshold is a fictional product choice, not a Google standard. The fixture evaluates the primary outcome; it supplies no measured guardrail results.
Build an analysis table at the assignment grain
Keep one row per randomized user: user_id, treatment, before and after. Deduplicate event IDs before aggregating completion counts. Aggregate each observation window before joining the assignment table; otherwise joining baseline events to outcome events can multiply both counts and records.
Retain all eligible assigned users, including people with no completion events. Validate unique assignment, window boundaries and logging coverage. A left join followed by a filter on an outcome-table field can accidentally turn into an inner join and remove zeros.
In this fixture every user has complete coverage and one assignment. Counts are generated directly rather than through an event store. To extend it to SQL, create separate baseline and outcome aggregates, left join each to assignments, and check both COUNT(*) and COUNT(DISTINCT user_id) after every join. Equality is necessary here, but it does not prove that a wrong filter has not dropped users; reconcile to the assignment roster too.
Runnable regression and a duplicate-aware repair
Save the following as regression_case.py. It requires NumPy; the published results were checked with NumPy 2.3.5. Run python regression_case.py. The code prints the clean analysis, an intentionally incorrect analysis of four identical copies per user, and the repaired table.
import json
import numpy as np
def fixture(seed=6363, n=2000):
rng = np.random.default_rng(seed)
treatment = np.repeat([0, 1], n // 2)
rng.shuffle(treatment)
before = rng.integers(0, 21, n)
after = np.maximum(0, np.rint(
7 + 0.5 * before + 0.35 * treatment + rng.normal(0, 3, n)))
return np.column_stack((np.arange(n), treatment, before, after))
def one_per_user(rows):
by_id = {}
for row in rows:
user = int(row[0])
if user in by_id and not np.array_equal(by_id[user], row):
raise ValueError('conflicting rows for one user')
by_id[user] = row.copy()
return np.array(list(by_id.values()))
def analyze(rows):
n = len(rows)
x = np.column_stack((np.ones(n), rows[:, 1], rows[:, 2] - 10))
y = rows[:, 3]
if n <= 3 or np.linalg.matrix_rank(x) != 3:
raise ValueError('need full-rank data and residual degrees of freedom')
beta = np.linalg.lstsq(x, y, rcond=None)[0]
residual = y - x @ beta
bread = np.linalg.inv(x.T @ x)
scores = x * residual[:, None]
covariance = n / (n - 3) * bread @ (scores.T @ scores) @ bread
se = float(np.sqrt(covariance[1, 1]))
effect = float(beta[1])
ci = [effect - 1.96 * se, effect + 1.96 * se]
total = float(((y - y.mean()) ** 2).sum())
return {'rows': n, 'effect': effect, 'hc1_se': se, 'ci95': ci,
'r2': 1 - float(residual @ residual) / total,
'raw_difference': float(y[rows[:, 1] == 1].mean()
- y[rows[:, 1] == 0].mean())}
if __name__ == '__main__':
clean = fixture()
duplicated = np.repeat(clean, 4, axis=0)
results = {name: analyze(data) for name, data in
[('unique_users', clean), ('incorrect_8000_rows', duplicated),
('repaired_users', one_per_user(duplicated))]}
print(json.dumps(results, indent=2))
The generator deliberately gives baseline activity a relationship with future activity and adds a treatment term of 0.35 before rounding and clipping. That generator parameter is not the observed estimate and is not a guaranteed exact effect after the transformations. Seed 6363 fixes this particular synthetic draw.
OLS fits an intercept, treatment indicator and centered pre-period activity. HC1 covariance uses residual-weighted scores and the n/(n−3) adjustment for the three fitted parameters. It permits heteroskedastic errors under the independence conditions; it does not repair duplicated or correlated observations.
Using least squares avoids solving the coefficient equation by a direct matrix inverse. The small, full-rank fixture still uses an inverse for the sandwich covariance. For ill-conditioned designs or production analysis, inspect conditioning and use established statistical software with an inference method appropriate to the data.
Read the result in its original units
| Analysis | Nominal rows | Adjusted effect | HC1 standard error | Approximate 95% interval |
|---|---|---|---|---|
| One record per user | 2,000 | 0.268771 | 0.131573 | 0.010888 to 0.526653 |
| Four copies treated as independent | 8,000 | 0.268771 | 0.065749 | 0.139902 to 0.397639 |
| Repaired user table | 2,000 | 0.268771 | 0.131573 | 0.010888 to 0.526653 |
The unadjusted treatment-minus-control mean is 0.159000. The adjusted coefficient is 0.268771 completed tasks per user. Adjustment changes this draw’s estimate because the pre-period activity differs by arm by chance; neither number is a percent lift or a probability.
The correct interval uses a large-sample normal approximation with multiplier 1.96. It excludes zero but does not establish that the benefit exceeds 0.20. Under the declared rule, hold the launch. The lower bound is only 0.010888, and no guardrail evidence has been supplied. Do not label the experiment a proven failure either: the interval contains effects above the threshold as well as smaller effects.

The correct interval’s width is about 0.516 tasks. If a later experiment needs more precision, plan its sample size and decision rule using a justified variance estimate. Do not continue checking an ordinary fixed-horizon test until its p-value becomes favorable; specify a sequential design or a new fixed experiment first.
Why copying rows changes apparent precision
Let every original row appear k times. Then the duplicated design satisfies X_kᵀX_k = kXᵀX and X_kᵀy_k = kXᵀy. The factors cancel in the OLS coefficient expression. Fitted values and residuals are repeated; ordinary, unadjusted R-squared is unchanged because both residual and total sums of squares scale by k.
For this HC1 calculation with p=3 coefficients, the ratio of the incorrectly computed duplicated standard error to the original is:
sqrt((n − p) / (k*n − p)).
For n=2,000 and k=4, that is approximately 0.499719. The apparent near-halving comes from a false independence assumption. A heteroskedasticity correction still regards the 8,000 rows as independent; its name does not make it duplicate-aware. Adjusted R-squared and some other reported summaries can change because they incorporate degrees of freedom.
The repair here accepts exact copies and rejects conflicting records for the same user. It fits this table’s one-user contract. It is not permission to discard repeated measurements from a longitudinal study: daily records can be real information with within-user dependence. For those data, define the estimand and use an appropriate clustered, repeated-measures or design-based analysis. Cluster-level randomization requires inference that reflects that assignment, not just a user-level covariance choice.
Explain significance without overstating it
A p-value describes how extreme the observed test statistic is under a specified null model and its assumptions. It is not the probability that the null hypothesis is true, the chance that the result is “random,” or a measure of the benefit’s size. An ordinary interval also does not mean there is a 95% posterior probability that this one fixed parameter lies inside it.
Mechanical duplication violates the independence assumption behind the naïve inference. Looking at many metrics, repeatedly checking results or selecting a subgroup after seeing outcomes creates additional inference problems. Report the outcome definition, assignment, exclusions, effect size, uncertainty and analysis choices together.
The chi-square part has a related but distinct lesson. Suppose a two-category goodness-of-fit test expects a 50/50 split and observes 1,010/990 among 2,000 genuinely independent observations. Its Pearson statistic is 0.2. In a separate much larger sample with the same 50.5/49.5 split, 101,000/99,000 among 200,000, the statistic is 20. The proportions differ by the same amount; Cohen’s goodness-of-fit effect size w = sqrt(chi-square/n) remains 0.01.
More independent data can reveal a small deviation precisely. Invented copies cannot. Report the size and practical consequence of the deviation alongside inference. Use multiplicity control for a declared family of tests; do not add an arbitrary penalty just to make an inconvenient p-value larger. Information criteria address a separate model-comparison question.

Defend the experiment’s assumptions
Random assignment supports causal interpretation when assignment and analysis are implemented correctly, outcomes are observed and relevant interference is absent or modeled. A baseline covariate measured before assignment is different from a variable changed by treatment. Conditioning on post-treatment engagement can change the estimand and introduce selection bias.
For this case, explain the observation window, assignment unit and meaning of a missing record. Investigate sample-ratio mismatch and differential logging before trusting the coefficient. Do not let the treatment group’s easier-to-record events appear to be additional completed tasks.
The simple additive adjustment is a teaching model. Real counts can be skewed, clustered or affected differently across users. Rehearse residual checks, a predeclared treatment-by-baseline interaction when appropriate, randomization-based inference or a user-level bootstrap as alternatives. If the assignment is by organization, preserve organizations when resampling. Those extensions are not executed by this fixture.
Turn the same case into three useful mocks
For analytics, start from the duplicated join and explain the source of the metric error, the checks that locate it and the corrected output. For experimentation, start before assignment and defend the metric, adjustment, independence and decision rule. For research, compare the additive model with an alternative and explain the evaluation design and limitations.
Practice a 90-second recommendation: “The adjusted estimate is 0.269 additional tasks per user. The correct approximate interval runs from 0.011 to 0.527. It does not meet our predeclared lower-bound threshold of 0.20, and we still need guardrail evidence. I recommend holding launch while resolving those questions. The 8,000-row export contains only 2,000 users and does not add precision.”
The local review passed 685 checks across 40 synthetic seeds, three duplicate factors, an independently derived scalar coefficient and influence-function standard error, treatment-label reversal, row-order invariance, duplicate repair and conflicting-record rejection. This verifies the teaching implementation and arithmetic, not the coverage of a statistical procedure in every real experiment or performance on a Google interview.
Build a short preparation cycle around artifacts you can explain: one checked query, one numerical inference, one product recommendation and one truthful project story. In a project discussion, separate what you implemented from what teammates did, the evidence available at decision time and the limitation that remained. A clear decision with an honest caveat is more useful than a memorized claim about a secret hiring bar.
Frequently asked questions
How should I choose a Google data scientist preparation track?
Match the actual job and recruiter-confirmed interview agenda. This guide separates analytics, experimentation and research preparation as study routes; it does not claim that Google uses three fixed interview loops.
What happens to regression coefficients when every row is duplicated?
Equal duplication multiplies both X transpose X and X transpose y by the same factor, leaving ordinary least-squares coefficients unchanged. Treating copies as independent can incorrectly shrink standard errors; no new independent evidence was collected.
Does an HC1 robust standard error fix duplicated users?
No. HC1 addresses heteroskedasticity under independent observations. For the accidental identical copies in this fixture, restore one record per user. Genuine repeated observations require an estimand and inference method that account for dependence.
Why hold a launch when the confidence interval excludes zero?
The original case requires the lower confidence bound to exceed a predeclared benefit threshold of 0.20 completed tasks per user. Its correct lower bound is 0.0109, so it does not meet that rule even though the interval excludes zero.
Can I use AI to answer a live Google interview?
Google’s published virtual-interview candidate guide prohibits AI help during the interview and submitting answers or code that you did not produce. It states that violations lead to disqualification. Confirm your approved tools and accommodation arrangements with your recruiter.
Sources and scope
- Google virtual-interview candidate guide: equipment, approved interview arrangements, confidentiality and AI/work-submission conduct.
- statsmodels OLS results documentation: HC1 covariance and reported regression quantities.
- statsmodels clustered covariance documentation: a separate inference option for grouped dependence.
- American Statistical Association p-value statement: interpretation, effect size and transparent reporting.
Checked October 9, 2026. The code runs locally on synthetic data; the product threshold and launch decision are original practice assumptions. No Google interview, private hiring rubric or real user experiment was observed. Confirm current role-specific details with your recruiter.