PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Verkada

Find motion intervals above threshold

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of time-series data processing and interval detection, focusing on grouping timestamped motion readings that exceed a numeric threshold and managing contiguous active segments.

  • medium
  • Verkada
  • Coding & Algorithms
  • Software Engineer

Find motion intervals above threshold

Company: Verkada

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

You are processing data from a single security camera. You are given: - A threshold value `T` (a real number). - A vector (array) of time-stamped motion readings. Each reading is a pair `[time, motion_level]`, where: - `time` is a strictly increasing integer timestamp (in seconds), - `motion_level` is a real number. Whenever `motion_level > T`, we consider the camera to be "active". Consecutive active readings form a continuous active interval from the time of the first active reading to the time of the last active reading in that group. Assume: - The input vector is sorted by `time` in strictly increasing order. - If two active readings are adjacent in the array (with no inactive reading between them), they belong to the same active interval, even if there is a time gap between their timestamps. - If a reading is inactive (`motion_level <= T`), it does not belong to any active interval. Return a list of active time intervals `[start_time, end_time]` covering all maximal contiguous segments of readings where `motion_level > T`. Example: - Input: - `readings = [[1, 0.4], [5, 0.2], [11, 0.9], [15, 0.9], [17, 0.8], [25, 0.5], [27, 0.8], [36, 0.9]]` - `T = 0.8` - Output: - `[[11, 17], [27, 36]]` Explanation: - Readings at times 11, 15, 17 have `motion_level > 0.8`, so they form one interval `[11, 17]`. - Readings at times 27 and 36 have `motion_level > 0.8`, forming interval `[27, 36]`. - All other readings have `motion_level <= 0.8` and are ignored. Implement a function that takes the readings and threshold and returns the list of such intervals.

Quick Answer: This question evaluates understanding of time-series data processing and interval detection, focusing on grouping timestamped motion readings that exceed a numeric threshold and managing contiguous active segments.

Related Interview Questions

  • Merge Sorted Arrays In Place - Verkada (medium)
  • Find and Merge Camera Alert Intervals - Verkada (hard)
  • Find user who can access every camera - Verkada (medium)
  • Implement LRU and LFU caches - Verkada (medium)
  • Validate a 9×9 grid under constraints - Verkada (medium)
Verkada logo
Verkada
Dec 8, 2025, 6:39 PM
Software Engineer
Technical Screen
Coding & Algorithms
7
0

You are processing data from a single security camera.

You are given:

  • A threshold value T (a real number).
  • A vector (array) of time-stamped motion readings. Each reading is a pair [time, motion_level] , where:
    • time is a strictly increasing integer timestamp (in seconds),
    • motion_level is a real number.

Whenever motion_level > T, we consider the camera to be "active". Consecutive active readings form a continuous active interval from the time of the first active reading to the time of the last active reading in that group.

Assume:

  • The input vector is sorted by time in strictly increasing order.
  • If two active readings are adjacent in the array (with no inactive reading between them), they belong to the same active interval, even if there is a time gap between their timestamps.
  • If a reading is inactive ( motion_level <= T ), it does not belong to any active interval.

Return a list of active time intervals [start_time, end_time] covering all maximal contiguous segments of readings where motion_level > T.

Example:

  • Input:
    • readings = [[1, 0.4], [5, 0.2], [11, 0.9], [15, 0.9], [17, 0.8], [25, 0.5], [27, 0.8], [36, 0.9]]
    • T = 0.8
  • Output:
    • [[11, 17], [27, 36]]

Explanation:

  • Readings at times 11, 15, 17 have motion_level > 0.8 , so they form one interval [11, 17] .
  • Readings at times 27 and 36 have motion_level > 0.8 , forming interval [27, 36] .
  • All other readings have motion_level <= 0.8 and are ignored.

Implement a function that takes the readings and threshold and returns the list of such intervals.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Verkada•More Software Engineer•Verkada Software Engineer•Verkada Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.