Pair Camera Frames With Lidar Sweeps Within a Tolerance
Last updated: November 29, 2026
Quick Overview
Given sorted camera timestamps and sorted lidar sweep timestamps, pair as many camera frames as possible with a lidar sweep whose timestamp differs by at most tol milliseconds, using each sweep at most once.
Applied Intuition
November 29, 20260
0
0 solved
Given sorted camera timestamps and sorted lidar sweep timestamps, pair as many camera frames as possible with a lidar sweep whose timestamp differs by at most tol milliseconds, using each sweep at most once.
Sensor fusion and log replay tooling at Applied Intuition constantly line up streams that run at different rates. This question checks whether you can justify a two-pointer greedy instead of reaching for a nested loop or a matching algorithm.
What the Interviewer Expects
- Exploit that both lists are sorted
- Advance the pointer whose element can never match anything later
- Argue why the greedy gives the maximum number of pairs
- Return the actual pairs, not just a count
- Run in linear time
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 instead pick the closest sweep for each frame when sweeps can be reused?
- What if clocks drift so the tolerance should grow over the log?
- How would you do this on two unbounded live streams?
- How would you report frames that had no match for a data-quality dashboard?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Two sorted lists of integer milliseconds and a tolerance. Each lidar sweep can be paired once. Goal: maximize the number of pairs and return them as (camera_ts, lidar_ts)....
High-Level Design
Keep pointers i (camera) and j (lidar). If the two are within tolerance, pair them and advance both. If the sweep is older than camera - tol, it cannot match this frame or any later one, so drop it....
Submit Your Answer
Applied Intuition Software Engineer Interview Guide
Interview process, tips, and preparation timeline