The interview problem

Practice prompt

Design a stereo-depth service for a fixed camera rig and explain the effect of disparity error.

Original practice, not a reported company interview. Scenarios and numbers are illustrative. Interview date: not applicable. Sources retrieved October 1, 2026.

1. Scope and worked approach

Rectify paired images using calibration, compute disparity, and mask low-confidence or inconsistent matches. Assume focal length in pixels and baseline in meters. Monitor calibration drift and synchronize exposure; evaluate at the operating distance range.

2. Trace the design or derivation

Synchronized pair
  → rectify
  → disparity
  → consistency mask
  → depth

At disparity 20±1 pixels the depths are approximately 3.81 to 4.21 m. Report this asymmetric transformation rather than treating depth error as constant. A wider baseline can improve geometry while increasing occlusion and changing the hardware constraints.

3. Calculate the example

For focal length 800 pixels, baseline 0.1 m and disparity 20 pixels, Z = fB/d = 4 m. At disparity 10 pixels the depth is 8 m; a one-pixel error becomes more consequential at long distance.

4. Failure cases and trade-offs

Textureless walls and reflections produce ambiguous matches. Zero disparity is not a finite reliable depth. A shifted camera invalidates otherwise good matching.

5. Validation, follow-ups and self-review

Test planar targets at known distances and deliberately perturb calibration. Follow-up: how do you choose baseline? Self-review: track units, invalid pixels and far-range uncertainty.

Sources and related practice

Technical reference: docs.opencv.org — Stereo disparity and inverse-disparity depth relation.

Source publication/update: Not established. Retrieved October 1, 2026. The workflow, calculations and review exercises are original; this reference is not evidence that a company asked this question.

Continue with Serve monocular depth with honest scale limits; Estimate motion between video frames.

Continue your preparation

Choose a connected learning path or browse more ML system design questions. Read our editorial method and attribution policy.