Trajectory, Kinematics, And Collision Analysis
Asked of: Data Scientist
Last updated

What's being tested
Interviewers probe your ability to convert vehicle motion into analyzable mathematical objects, select appropriate statistical or numerical methods, and reason about uncertainty and scale. They expect clear problem framing (assumptions, observables), correct kinematic modeling (relative motion → algebraic root problems or time-series comparisons), and principled evaluation metrics that capture safety-relevant errors. For Waymo, the focus is on defensible, reproducible analysis (false positive/negative tradeoffs, calibration) rather than low-level sensor plumbing.
Core knowledge
-
Relative motion reduction: For two objects with positions
p1(t),p2(t), define relative positionr(t)=p1(t)-p2(t); collision when (sum of radii). Squared-distance is the central scalar function to analyze. -
Quadratic closed-form case: If each object moves linearly (
p(t)=p0+v t), then ; solve via discriminant . Real roots → collision interval; → grazing/tangent contact. -
Numerical root-finding: For higher-order/parametric trajectories (splines, polynomials), use robust solvers (
brentq, Brent’s method) on with bracketed intervals; prefer bracketed methods over pure Newton to avoid divergence. -
Piecewise models & monotonicity: Break trajectories into segments where motion model is simple (constant velocity/acceleration or low-order spline). Solve per-segment and merge intervals — avoids global multimodality pitfalls.
-
Discrete sampling & interpolation: Real logs are sampled; use sinc-compatibility thinking: ensure interpolation (linear / cubic spline) doesn't introduce spurious crossings. Report resolution-limited uncertainty: sample interval sets minimum resolvable time-to-collision.
-
Uncertainty propagation: For Gaussian position noise, linearize root solution to approximate time uncertainty via the implicit function theorem, or compute confidence intervals via bootstrap or Monte Carlo perturbation of trajectories.
-
Scalability & candidate filtering: Naive pairwise is ; for up to a few hundred (typical road scene) it's fine, but for thousands use spatial bucketing /
R-tree-style prefiltering or coarse time-to-contact heuristics to prune pairs. Document assumptions about upstream sampling frequency. -
Trajectory comparison metrics: For comparing turns use Dynamic Time Warping (DTW), Fréchet distance, or functional summaries (curvature, yaw-rate, lateral displacement) and model differences with mixed-effects or permutation tests to control vehicle-level correlation.
-
Statistical testing & multiple comparisons: When testing many segments/cohorts, correct p-values using Benjamini–Hochberg or conservative Bonferroni depending on FDR vs family-wise error tradeoffs.
-
Evaluation metrics for collision prediction: Use precision–recall curves and area under PR (AUPR) for imbalanced events; report time-error metrics like MAE of predicted time-to-collision and calibration curves for estimated probabilities.
-
Edge cases: Handle initial overlaps (collision at ), tangential grazes ( numerical sensitivity), and very-high-speed/low-radius pairs that amplify discretization and floating-point errors.
-
Safety-aware thresholds: For alarm systems, preferring higher recall (catch all imminent collisions) may be mandated; quantify business cost with a simple cost matrix and optimize thresholds accordingly.
Tip: Always state whether you assume continuous-time analytic trajectories or discrete logged samples — it determines analytic vs numerical solution choices.
Worked example — Determine earliest collision among moving cars
First 30s framing: ask what observables you have (position, velocity, vehicle radii, sample rate), what motion model is acceptable (constant velocity, constant accel, or spline-interpolated), and the time window of interest. Skeleton answer pillars: (1) reduce to per-pair relative-position problem r(t) and , (2) choose solver: closed-form quadratic if linear motion, otherwise bracketed numerical root-finding per segment, (3) scale/prune candidate pairs and quantify uncertainty. A strong candidate explicitly handles initial overlap and tangency: check at (immediate collision), and treat with a tolerance epsilon tied to measurement noise. Tradeoff to flag: using high-order spline interpolation reduces discretization error but can create oscillatory artifacts and expensive root-finding; prefer piecewise low-order fits with adaptive sampling. To close: report earliest collision time with confidence interval, show complexity ( segments × pairs after pruning), and say "if I had more time, I'd add Monte Carlo uncertainty quantification and a labeled holdout to estimate false positive rate under realistic sensor noise."
A second angle — How compare Waymo turning trajectories statistically
Here the task shifts from pairwise collision roots to population-level comparison of turning behavior. Apply the same fundamental reduction: represent each trajectory as a time-indexed function (x(t), y(t)) or as a path in Frenet frame (longitudinal vs lateral offset relative to lane center). Extract interpretable features: curvature , yaw-rate, lateral displacement at matched arc-length, and time-normalized speed profiles. Use functional-data techniques (mixed-effects models or Gaussian Process regression) to model per-vehicle random effects and test treatment/cohort fixed effects (autonomous vs baseline). For non-time-aligned turns, use DTW or elastic registration to align phases before averaging; when you report significance, correct for vehicle-level clustering (cluster-robust SEs) and multiple segments. The common concept — converting raw trajectories to analyzable functions and choosing alignment + appropriate null distribution — carries across both tasks.
Common pitfalls
Pitfall: Assuming closed-form quadratics everywhere. Many real-world trajectories are non-linear or spline-interpolated; blindly applying the quadratic formula will miss collisions or produce imaginary roots.
Pitfall: Ignoring sampling resolution and noise when reporting collision time. Claiming sub-millisecond precision without uncertainty quantification or sensor-rate justification undermines credibility.
Pitfall: Using pointwise t-tests on time-series without accounting for temporal correlation or vehicle-level clustering; this inflates false positives. Use functional tests, mixed models, or permutation strategies.
Connections
These analyses commonly pivot to trajectory clustering and anomaly detection, time-to-collision (TTC) modeling and calibration, and probabilistic filtering like the Kalman filter for state estimation. Interviewers may also ask to validate models with holdout scenarios or to design experiments that measure behavioral change after a software update.
Further reading
-
[Brent, R.P., "Algorithms for Minimization Without Derivatives"] — reliable reference for robust 1-D root-finding (bracketing methods).
-
[Ramsay & Silverman, "Functional Data Analysis"] — practical methods for representing and testing differences between trajectories.
Practice questions
Related concepts
- Grid, Matrix And Spatial AlgorithmsCoding & Algorithms
- Autonomous Vehicle Safety MetricsAnalytics & Experimentation
- Simulation Agent Behavior ModelingML System Design
- Graph Algorithms, Search, And SnapshottingCoding & Algorithms
- Graphs, Grids, And Connected ComponentsCoding & Algorithms
- Survival Analysis And Time-To-Event ModelingStatistics & Math