The interview problem

Practice prompt

Design a batch optical-flow service for an editor that needs per-pixel motion and uncertainty masks.

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

Decode frames with timestamps, estimate pairwise flow, and expose occlusion or unreliable regions separately. Split evaluation by source video. Compare learned flow with a simpler baseline on the same frame pairs; preserve units as pixels per frame interval.

2. Trace the design or derivation

Timestamped frame pair
  → flow model
  → validity mask
  → versioned vector field

For downstream interpolation, compare the actual edited result as well as flow error. A small average error can still produce a visible boundary tear. Cache by both frame identities, transform parameters and model version so a crop cannot reuse an incompatible motion field.

3. Calculate the example

A point moves 12 pixels over 40 ms, equivalent to 300 pixels/second in image coordinates. Doubling the frame interval changes displacement even if physical motion is unchanged.

4. Failure cases and trade-offs

Occlusion has no true visible correspondence; repetitive textures and scene cuts can produce confident nonsense. Resizing without rescaling flow vectors changes the interpretation.

5. Validation, follow-ups and self-review

Evaluate endpoint error on visible regions, cut handling and runtime. Follow-up: how does variable frame rate affect consumers? Self-review: explain vector units, masks and resize transformations.

Sources and related practice

Technical reference: arxiv.org — RAFT optical-flow estimation.

Source publication/update: 2020-03-26; revised 2020-08-25. 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 Track anonymous objects through a camera view; Find action intervals inside long videos.

Continue your preparation

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