← Waymo Interview Insights

Waymo·Data Analyst·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Jun 2026

Summary

Interviewed at Waymo, got a geo/data problem that felt deceptively simple on the surface. Short round, one question, left feeling like I either nailed it or completely missed the point.

Questions Asked (1)

Q1

How would you calculate the average distance between cities?

Algorithms & Data StructuresData Modeling
Author's notes

My first instinct was to just say 'sum all pairwise distances and divide' but then I started second-guessing myself on what 'average' even means here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the definition of 'average distance' and the scope (e.g., all city pairs, nearest neighbors, or a sample). Then outline a method to compute pairwise distances using geographic coordinates and discuss computational challenges and optimizations for large datasets.

Pro tip: Mention that for large numbers of cities, computing all pairwise distances is O(n^2) and may be infeasible; instead, consider sampling or using spatial indexing to approximate the average. Also, highlight the importance of using the Haversine formula for accurate great-circle distances.

1. Clarify the question

Ask whether 'average distance' means average over all pairs of cities, average distance to nearest city, or something else. Also confirm the set of cities and whether we need road distance or straight-line distance.

2. Choose distance metric

Decide between Euclidean, Manhattan, or Haversine (great-circle) distance. For geographic coordinates, Haversine is most accurate for straight-line distances.

3. Compute pairwise distances

For n cities, compute distances for all n*(n-1)/2 pairs. Use vectorized operations or spatial libraries to speed up computation.

4. Calculate the average

Sum all pairwise distances and divide by the number of pairs to get the average distance.

5. Address scalability and optimizations

For large n, discuss sampling, spatial indexing (e.g., KD-trees), or approximate methods. Also consider if the average should be weighted by population or other factors.

Key Points to Mention

  • Haversine formula for great-circle distance
  • Computational complexity O(n^2) for all pairs
  • Sampling or approximation for large datasets
  • Spatial indexing (e.g., KD-trees, ball trees)
  • Weighting by population or importance
  • Difference between straight-line and road distance

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