Common Camera Motion Intervals
Updated
Problem statement
Each camera provides strictly increasing integer timestamps and a motion intensity for every timestamp. For one camera, a motion period is a maximal consecutive run of samples whose intensity is at least threshold; its inclusive interval runs from the first qualifying timestamp through the last.
Return the sorted inclusive intervals during which every camera is simultaneously in one of its motion periods.
Function
commonMotionIntervals(timestamps: int[][], intensities: double[][], threshold: double) → int[][]Examples
Example 1
timestamps = [[1,2,3,4,5]]intensities = [[0.1,0.7,0.8,0.2,0.9]]threshold = 0.6return = [[2,3],[5,5]]The qualifying samples form two maximal runs.
Example 2
timestamps = [[1,2,3,4,5],[0,2,3,5,6]]intensities = [[0.8,0.8,0.2,0.9,0.9],[0.1,0.7,0.7,0.7,0.2]]threshold = 0.7return = [[2,2],[4,5]]Intersecting [1,2] and [4,5] with the second camera's [2,5] gives two common periods.
Constraints
1 <= timestamps.length == intensities.length <= 1001 <= timestamps[c].length == intensities[c].length- The total sample count is at most
200000. - Each timestamp row is strictly increasing and values fit in signed 32-bit integers.
0.0 <= intensities[c][i], threshold <= 1.0
More Verkada Phone Screen questions
- Find the Unique User with Access to Every CameraPHONE SCREEN · Seen Nov 2026
- Host Log ParserPHONE SCREEN · Seen Sep 2026
- Valid SudokuPHONE SCREEN · Seen Sep 2026
- Time-Based Key-Value StorePHONE SCREEN · Seen Aug 2026
- Camera Log API SequencePHONE SCREEN · Seen Aug 2026
- Find Valid IP AddressesPHONE SCREEN · Seen Apr 2026
Similar questions at other companies
- Meeting Rooms IIUber · PHONE SCREENUber interview questions
- Meeting Rooms IIAmazon · PHONE SCREEN · ONSITE INTERVIEW
- Intersect Two Sorted Interval ListsByteDance · PHONE SCREENByteDance interview questions
- Meeting Rooms IIWalmart · PHONE SCREENWalmart interview questions
- Intersect Two Interval ListsSuperhuman · PHONE SCREENSuperhuman interview questions
- Find Shared Camera Activity PeriodsServal · PHONE SCREEN
- Earliest Common Meeting SlotAdobe · PHONE SCREENAdobe interview questions
- Intersections of Two Interval ListsDatadog · PHONE SCREENDatadog interview questions
- Interval List IntersectionsGoogle · ONSITE INTERVIEWGoogle interview questions
- Most Employees Working at OnceCitadel · OACitadel interview questions