← Verkada Interview Insights

Verkada·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Verkada phone screen for a software engineer role. The problem was surveillance-themed which felt on-brand but the actual coding was two distinct algorithmic tasks back to back, and the follow-up complexity discussion caught me a bit flat-footed.

Questions Asked (2)

Q1

Given a list of timestamped sensor readings and a threshold value, find all maximal intervals during which the sensor reading exceeds the threshold. The interval ends at the last timestamp before the value drops back to or below the threshold, and if it's still above at the end, close it there.

Algorithms & Data Structures
Author's notes

I got the basic logic down pretty quick: scan through, track whether you're in an alert state, open an interval when you cross the threshold and close it when you drop back.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the input format and edge cases, then propose a single-pass linear scan that tracks whether we are inside an interval. When the reading exceeds the threshold and we are not in an interval, start a new interval; when it drops to or below and we are in an interval, close it at the previous timestamp. Handle the end-of-list case by closing any open interval at the last timestamp.

Pro tip: Mention that you would confirm whether the sensor readings are sorted by timestamp and whether duplicate timestamps can occur, as these affect the algorithm and edge-case handling. Also, explicitly state that the interval ends at the last timestamp before the drop, not at the drop itself, to show attention to detail.

1. Clarify requirements and edge cases

Ask about input format (list of (timestamp, value) pairs), whether timestamps are sorted, if duplicates are possible, and how to handle empty lists or all values above/below threshold.

2. Outline the single-pass algorithm

Explain that you will iterate through the readings once, maintaining a state variable to indicate if you are currently inside an interval, and record start and end timestamps accordingly.

3. Detail the interval logic

When value > threshold and not in interval, set start = current timestamp and mark in interval. When value <= threshold and in interval, set end = previous timestamp, add interval, and mark not in interval.

4. Handle the end-of-list case

After the loop, if still in an interval, close it at the last timestamp of the list and add it to the result.

5. Analyze complexity and test

State that the algorithm runs in O(n) time and O(1) extra space (excluding output), and walk through a small example to verify correctness.

Key Points to Mention

  • Single-pass linear scan with O(n) time complexity
  • State tracking to know when an interval starts and ends
  • Edge cases: empty input, all values above threshold, all below, threshold exactly equal to reading
  • Interval closure at the last timestamp before the drop, not at the drop
  • Handling of unsorted timestamps (if applicable) or assumption of sorted order
  • Output format: list of intervals as (start_timestamp, end_timestamp) pairs

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Given alert intervals from multiple cameras, merge them into a single sorted list of non-overlapping intervals where touching intervals (e.g. [1,3] and [3,5]) are treated as overlapping and should be merged.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Classic interval merge, but the touching-counts-as-overlap rule is the small twist.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify that the input is a collection of intervals from multiple cameras, then flatten all intervals into a single list and sort by start time. Iterate through the sorted intervals, merging any that overlap or touch (i.e., when the next start <= current end), and output the merged list.

Pro tip: Explicitly state that you treat touching intervals as overlapping by using a <= comparison, and mention that this handles edge cases like zero-length intervals and ensures correctness. Also, discuss the trade-off between sorting all intervals upfront (O(n log n)) versus using a heap for streaming data, showing awareness of scalability.

1. Clarify input and output

Confirm that the input is a list of intervals (each with start and end) from multiple cameras, and the output should be a sorted list of non-overlapping intervals with touching intervals merged.

2. Flatten and sort

Combine all intervals into a single list and sort them by start time (and end time if starts are equal). This ensures we process intervals in order.

3. Iterate and merge

Initialize an empty result list. For each interval in sorted order, if the result is empty or the current interval's start is greater than the last merged interval's end, append it; otherwise, merge by updating the last interval's end to the maximum of both ends.

4. Handle touching intervals

Use a <= comparison when checking overlap (i.e., if current.start <= last.end, merge) to treat touching intervals as overlapping.

5. Analyze complexity and edge cases

State time complexity O(n log n) due to sorting and space O(n) for the output. Discuss edge cases: empty input, single interval, all intervals overlapping, and intervals with same start times.

Key Points to Mention

  • Sorting intervals by start time is crucial for efficient merging.
  • Use a <= comparison to merge touching intervals (e.g., [1,3] and [3,5] become [1,5]).
  • Time complexity: O(n log n) due to sorting; space complexity: O(n) for the output.
  • Edge cases: empty input, single interval, intervals with identical start times, and intervals that are completely contained within others.
  • Trade-offs: sorting all intervals upfront vs. using a heap for streaming data; memory vs. time considerations.
  • Correctness: after merging, the result is sorted and non-overlapping, and all original intervals are covered.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.