I could not answer Part 2 and was rejected.
Part 1 — Single Camera
Imagine that a camera installed in your building can detect motion. The camera outputs a stream of timestamps and a value indicating the motion intensity at each time.
You collect this data and want to determine the periods when the motion was at or above a given threshold.
Write a function that takes an array of sorted (timestamp, motion_intensity) pairs and outputs the periods when motion was at or above a threshold between 0 and 1.
The output should be an array of timestamp pairs. The first value in each pair is the start of a period at or above the threshold, and the last value is the inclusive end of that period.
Part 2 — Multiple Cameras
Now imagine that multiple cameras are installed, and you want to compute the periods when the motion intensity across all of them is at or above the threshold at the same time.
Write a function that takes an array of motion-data streams and outputs the periods when the motion detected across all of the streams is at or above the threshold.
Discussion
Loading comments…