← Waymo Interview Insights

Waymo·Data Scientist·Technical Phone Screen·Senior

Senior
Jul 2024San Francisco

Summary

Waymo data scientist interview that was pretty much a single extended case study on A/B testing for a routing algorithm. The whole thing revolved around experiment design and statistical validity, which I thought I knew well until the follow-ups made me second-guess myself.

Questions Asked (4)

Q1

Write Python code to filter ride data to San Francisco in July 2024, join it to experiment assignments, run a Welch two-sample t-test comparing treatment vs. control time-to-pickup, and return the p-value.

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

Felt okay about the pandas part but I second-guessed myself on why Welch specifically versus a standard t-test.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the data schema and assumptions (e.g., table names, column names, date format, and whether 'July 2024' means the full month). Then outline a pandas-based solution: filter rides to San Francisco and July 2024, join with experiment assignments on ride_id or user_id, split into treatment and control groups, and run scipy.stats.ttest_ind with equal_var=False to get the p-value. Finally, mention edge cases like missing assignments or multiple rides per user.

Pro tip: Always validate the join and group sizes before testing—if the treatment and control groups are imbalanced or have missing data, the p-value may be misleading. Also, consider whether the metric is per-ride or per-user, as this affects the independence assumption of the t-test.

1. Clarify data and requirements

Ask about table schemas, column names, date handling, and whether the analysis is at ride or user level. Confirm the definition of 'time-to-pickup' and the experiment assignment logic.

2. Filter and join data

Use pandas to filter rides to San Francisco and July 2024, then join with experiment assignments on the appropriate key (e.g., ride_id or user_id). Handle missing assignments appropriately.

3. Split groups and check assumptions

Separate the joined data into treatment and control groups. Check sample sizes, missing values, and outliers. Consider whether the t-test assumptions (independence, normality) are reasonable.

4. Run Welch's t-test

Use scipy.stats.ttest_ind with equal_var=False on the time-to-pickup values for treatment and control. Extract and return the p-value.

5. Interpret and communicate

Report the p-value along with group means and confidence intervals. Discuss practical significance and any caveats (e.g., multiple testing, novelty effects).

Key Points to Mention

  • Use of pandas for filtering and joining (e.g., pd.merge with how='inner' or 'left')
  • Welch's t-test via scipy.stats.ttest_ind(equal_var=False) to handle unequal variances
  • Importance of checking group sizes and missing data before testing
  • Consideration of whether the unit of analysis is ride or user, and implications for independence
  • Handling of date filtering (e.g., using pd.to_datetime and dt.month/dt.year)
  • Potential need for multiple comparison correction if testing multiple metrics

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

Q2

Given a returned p-value, how would you decide whether the result is statistically significant?

A/B Testing & Experimentation
Author's notes

Standard p-value threshold question.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying that statistical significance depends on both the p-value and the pre-defined significance level (alpha), typically 0.05. Then explain that you compare the p-value to alpha, but also consider practical significance, effect size, and the context of the experiment. Emphasize that a p-value alone is not sufficient; you must also check assumptions and avoid common pitfalls like multiple testing.

Pro tip: Mention that at a company like Waymo, where safety is critical, you would also look at confidence intervals and effect sizes to assess practical significance, not just statistical significance. This shows you understand the business context and go beyond textbook definitions.

1. State the decision rule

Compare the p-value to the pre-determined significance level (alpha). If p-value < alpha, reject the null hypothesis and declare statistical significance.

2. Check assumptions and validity

Ensure the test's assumptions (e.g., independence, normality, random sampling) are met, and that the experiment was properly designed and executed.

3. Consider practical significance

Evaluate the effect size and confidence interval to determine if the result is meaningful in the real-world context, not just statistically significant.

4. Account for multiple testing

If multiple comparisons were made, apply corrections (e.g., Bonferroni, FDR) to control the family-wise error rate or false discovery rate.

5. Make a decision in context

Combine statistical evidence with business impact, costs, and risks to make a final recommendation or decision.

Key Points to Mention

  • Definition of p-value: probability of observing data as extreme or more extreme given the null hypothesis is true.
  • Significance level (alpha): threshold for decision, commonly 0.05, but can vary based on context.
  • Type I and Type II errors: false positive and false negative, and their implications.
  • Effect size and confidence intervals: measures of practical significance.
  • Multiple testing corrections: Bonferroni, Benjamini-Hochberg, etc.
  • Contextual factors: business impact, safety, cost, and ethical considerations.

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

Q3

Is a statistically significant p-value conclusive proof that the new routing algorithm is better? If not, what are the main threats to validity?

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

This is where I got a little tripped up.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by directly stating that a statistically significant p-value is not conclusive proof, as it only indicates that the observed effect is unlikely under the null hypothesis. Then, systematically discuss the main threats to validity, including practical significance, multiple testing, novelty effects, and external factors. Conclude by emphasizing the need for a holistic evaluation combining statistical, practical, and business considerations.

Pro tip: Mention that at a company like Waymo, where safety and reliability are paramount, even a statistically significant improvement must be weighed against operational constraints and potential risks. Highlight the importance of replication and out-of-sample validation to ensure robustness.

1. Clarify the meaning of p-value

Explain that a p-value measures the probability of observing the data (or more extreme) assuming the null hypothesis is true. It does not measure the probability that the null hypothesis is true or that the alternative is true.

2. Distinguish statistical vs. practical significance

Discuss that a small p-value does not imply a large or meaningful effect. The effect size and confidence interval should be considered to assess practical significance.

3. Identify threats to validity

List and explain threats such as multiple comparisons (p-hacking), novelty effects, selection bias, confounding variables, and external validity issues (e.g., sim-to-real gap).

4. Consider experimental design and context

Emphasize the importance of proper randomization, sufficient sample size, and controlling for variables. In the context of routing algorithms, consider metrics like safety, latency, and user experience.

5. Recommend a comprehensive evaluation

Suggest combining statistical evidence with domain knowledge, business impact, and replication studies. Advocate for a decision-making framework that weighs risks and benefits.

Key Points to Mention

  • p-value does not prove the alternative hypothesis; it only rejects the null.
  • Effect size and confidence intervals are crucial for practical significance.
  • Multiple testing increases false positive risk; corrections like Bonferroni or FDR are needed.
  • Novelty effects and long-term effects may not be captured in short experiments.
  • External validity: results from simulation or limited trials may not generalize to real-world conditions.
  • Decision-making should incorporate business metrics, safety, and cost-benefit analysis.

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

Q4

Propose a stronger experiment design and analysis plan for this routing algorithm.

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

Probably the most interesting part.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the current experiment design and its limitations, then propose a stronger design that addresses those gaps, such as using a switchback or cluster-randomized design to handle interference. Outline a rigorous analysis plan that includes pre-registration, power analysis, and appropriate statistical methods to estimate causal effects.

Pro tip: Emphasize the importance of pre-registering the analysis plan and simulating the experiment to validate design assumptions, as this demonstrates rigor and foresight that senior data scientists at Waymo value.

1. Clarify Current Design and Goals

Ask questions to understand the existing routing algorithm, the current experiment design, and the key metrics (e.g., safety, efficiency, passenger comfort). Identify the specific limitations or concerns with the current approach.

2. Propose a Stronger Experimental Design

Suggest a design that mitigates interference and bias, such as a switchback design (alternating algorithms over time) or cluster randomization (randomizing at the level of geographic regions or fleets). Discuss trade-offs and justify your choice.

3. Define Metrics and Power Analysis

Specify primary and secondary metrics, including safety-critical ones. Conduct a power analysis to determine sample size and experiment duration, considering variance and minimum detectable effect.

4. Outline Analysis Plan

Detail the statistical methods for analysis, such as intent-to-treat, difference-in-differences, or Bayesian hierarchical models. Include plans for handling missing data, outliers, and multiple comparisons.

5. Address Validity and Operational Considerations

Discuss how to ensure internal and external validity, including randomization checks, blinding, and monitoring for novelty effects. Consider operational constraints like safety regulations and real-world deployment.

Key Points to Mention

  • Interference between experimental units and how to mitigate it (e.g., switchback, cluster randomization)
  • Pre-registration of analysis plan to avoid p-hacking and ensure credibility
  • Power analysis and sample size calculation to detect meaningful effects
  • Use of surrogate metrics or leading indicators for safety in early stages
  • Handling of multiple comparisons and false discovery rate control
  • Simulation or synthetic control to validate design before deployment

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