Interpolate Redaction Boxes Between Keyframes For Any Video Frame
Last updated: November 29, 2026
Quick Overview
A redaction track stores bounding boxes only at keyframes. Given several tracks (faces, license plates) and a frame number, return the box for every track active at that frame, linearly interpolating between surrounding keyframes.
Axon
November 29, 20260
0
0 solved
A redaction track stores bounding boxes only at keyframes. Given several tracks (faces, license plates) and a frame number, return the box for every track active at that frame, linearly interpolating between surrounding keyframes.
Before footage is released to the public or defense, agencies redact faces and plates, and Axon's redaction tools let a user or model place boxes on a few frames and fill in the rest. The interviewer checks binary search over keyframes, correct interpolation math, and sensible behavior outside a track's lifetime.
What the Interviewer Expects
- Skip tracks whose lifetime does not include the frame
- Use binary search to find the bracketing keyframes
- Interpolate all four box coordinates with the same alpha
- Return exact keyframe boxes without interpolation
- Discuss rounding to integer pixels
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you render an entire 30 fps video efficiently rather than per-frame queries?
- How would you support a track that disappears and reappears (occlusion)?
- When is linear interpolation a bad fit and what would you use instead?
- How should the box be padded to make sure nothing leaks at fast motion?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input: tracks dict id to list of (frame, (x, y, w, h)) sorted by frame; a query frame. A track is active from its first to its last keyframe inclusive. Output: dict id to integer box. Single-key...
High-Level Design
Per track, check lifetime bounds, then bisect_right over keyframe frames gives j, the first keyframe strictly after the query. Keyframe j-1 is at or before. If it equals the query (or there is n...