Find Unrecorded Gaps In A Body Camera Incident Window

Last updated: November 29, 2026

Quick Overview

Given an incident window [start, end) and a list of recording segments from one officer's body camera (possibly overlapping or extending outside the window), return the sorted list of sub-intervals inside the window where nothing was recorded.

Axon
Coding & Algorithms
Software Engineer
Axon
November 29, 2026
Software Engineer
Phone Screen
Coding & Algorithms
Easy

0

0

0 solved


Given an incident window [start, end) and a list of recording segments from one officer's body camera (possibly overlapping or extending outside the window), return the sorted list of sub-intervals inside the window where nothing was recorded.

A warm-up in the style of Axon's phone screens, framed around Axon Evidence showing supervisors which parts of a call for service have no footage. The interviewer checks clean interval handling, clipping to a window, and attention to half-open boundaries.

What the Interviewer Expects
  • Clip each segment to the window before merging
  • Sort by start and sweep with a cursor
  • Treat touching segments as continuous coverage
  • Handle the empty segment list and full coverage cases
  • State O(n log n) time
Key Topics to Cover
intervals
sorting
sweep line
boundary handling
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you return total recorded seconds as well?
  • What changes if segments arrive as a live stream already sorted?
  • How would you answer this for many officers on the same incident at once?
  • How would you handle clock drift between two cameras' segment times?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Input: window_start, window_end (seconds), and segments as (start, end) half-open pairs. Output: half-open gaps inside the window, in order. Segments may overlap, be unsorted, or lie partly ou...

High-Level Design

Clip every segment to the window and drop empties. Sort by start. Keep a cursor meaning "everything before here is either covered or already reported as a gap". For each segment, if it starts after ...


Submit Your Answer
Markdown supported

Related Questions