PracHub
QuestionsCoachesLearningGuidesInterview Prep
|Home/Statistics & Math/Tesla

Compute Point-to-Plane Distance and Fit a Robust Plane

Last updated: Jul 14, 2026

Quick Overview

Compute vectorized point-to-plane distances and robustly fit a dominant 3D plane when roughly 30 percent of points are outliers. Address normalization, degenerate samples, reproducible hypothesis scoring, model refinement, numerical checks, and outlier classification.

  • hard
  • Tesla
  • Statistics & Math
  • Software Engineer

Compute Point-to-Plane Distance and Fit a Robust Plane

Company: Tesla

Role: Software Engineer

Category: Statistics & Math

Difficulty: hard

Interview Round: Technical Screen

# Compute Point-to-Plane Distance and Fit a Robust Plane Use NumPy-style vectorized operations to solve both parts of this 3D geometry exercise. ### Constraints & Assumptions - Points are supplied as a finite floating-point array with shape (n, 3). - A plane is represented by coefficients (a, b, c, d) for ax + by + cz + d = 0. - In Part 2, approximately 70% of the points come from one physical plane and the rest are other objects or noise. - The distance threshold is provided in the same units as the coordinates. - Degenerate inputs must be detected rather than silently producing NaN values. ### Clarifying Questions to Ask - Is the threshold an absolute geometric distance? - What numerical tolerance should define a degenerate plane or collinear sample? - Must the returned normal have a canonical sign and unit length? - Is randomized fitting acceptable, and must runs be reproducible? ### Part 1: Vectorized Distances Given points and plane coefficients, return the unsigned perpendicular distance from every point to the plane without a Python loop over points. #### Hints - Express the numerator for all points as one matrix operation. - Determine which property of the coefficient vector makes the result invariant to rescaling the equation. #### What This Part Should Cover - Correct dimensions and normalization - Vectorized computation - Degenerate-normal handling ### Part 2: Robust Plane and Outliers Estimate the dominant plane despite roughly 30% outliers, then return the indices whose distance from the final plane exceeds the threshold. Describe a deterministic or seeded implementation and how you refine the estimate. #### Hints - A small subset can propose a hypothesis. - Separate hypothesis selection from final parameter estimation. #### What This Part Should Cover - Robustness to a large outlier fraction - A reproducible model-selection rule - Refinement and outlier classification - Numerical edge cases ### What a Strong Answer Covers - A correct geometric derivation - Careful NumPy shapes and floating-point checks - A robust estimator with explicit scoring and tie-breaking - Complexity, reproducibility, and failure behavior ### Follow-up Questions - How many random hypotheses are needed for a desired success probability? - How would heteroscedastic sensor noise change the inlier rule? - How would you fit several planes rather than only the dominant one?

Quick Answer: Compute vectorized point-to-plane distances and robustly fit a dominant 3D plane when roughly 30 percent of points are outliers. Address normalization, degenerate samples, reproducible hypothesis scoring, model refinement, numerical checks, and outlier classification.

Related Interview Questions

  • Explain and derive importance sampling estimators - Tesla (hard)
|Home/Statistics & Math/Tesla

Compute Point-to-Plane Distance and Fit a Robust Plane

Tesla logo
Tesla
Jul 7, 2026, 12:00 AM
hardSoftware EngineerTechnical ScreenStatistics & Math
1
0

Compute Point-to-Plane Distance and Fit a Robust Plane

Use NumPy-style vectorized operations to solve both parts of this 3D geometry exercise.

Constraints & Assumptions

  • Points are supplied as a finite floating-point array with shape (n, 3).
  • A plane is represented by coefficients (a, b, c, d) for ax + by + cz + d = 0.
  • In Part 2, approximately 70% of the points come from one physical plane and the rest are other objects or noise.
  • The distance threshold is provided in the same units as the coordinates.
  • Degenerate inputs must be detected rather than silently producing NaN values.

Clarifying Questions to Ask

  • Is the threshold an absolute geometric distance?
  • What numerical tolerance should define a degenerate plane or collinear sample?
  • Must the returned normal have a canonical sign and unit length?
  • Is randomized fitting acceptable, and must runs be reproducible?

Part 1: Vectorized Distances

Given points and plane coefficients, return the unsigned perpendicular distance from every point to the plane without a Python loop over points.

Hints

  • Express the numerator for all points as one matrix operation.
  • Determine which property of the coefficient vector makes the result invariant to rescaling the equation.

What This Part Should Cover

  • Correct dimensions and normalization
  • Vectorized computation
  • Degenerate-normal handling

Part 2: Robust Plane and Outliers

Estimate the dominant plane despite roughly 30% outliers, then return the indices whose distance from the final plane exceeds the threshold. Describe a deterministic or seeded implementation and how you refine the estimate.

Hints

  • A small subset can propose a hypothesis.
  • Separate hypothesis selection from final parameter estimation.

What This Part Should Cover

  • Robustness to a large outlier fraction
  • A reproducible model-selection rule
  • Refinement and outlier classification
  • Numerical edge cases

What a Strong Answer Covers

  • A correct geometric derivation
  • Careful NumPy shapes and floating-point checks
  • A robust estimator with explicit scoring and tie-breaking
  • Complexity, reproducibility, and failure behavior

Follow-up Questions

  • How many random hypotheses are needed for a desired success probability?
  • How would heteroscedastic sensor noise change the inlier rule?
  • How would you fit several planes rather than only the dominant one?
Loading comments...

Browse More Questions

More Statistics & Math•More Tesla•More Software Engineer•Tesla Software Engineer•Tesla Statistics & Math•Software Engineer Statistics & Math

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.