Vanta·Software Engineer·Technical Phone Screen
- Implement a log(test_id, timestamp, status) function to record test runs where timestamps are strictly increasing across all test IDs. Then implement get_min_time_to_pass(test_id) that returns the minimum duration from the start of any consecutive failure streak to the next passing status, or null if the test never passes.
- Using the same log() function, implement get_longest_failure_window(min_tests) that returns the start and end timestamps of the longest contiguous time window where at least min_tests distinct tests are failing simultaneously. Return null if no such window exists.
“The log part was fine, just needed a sorted structure keyed by timestamp globally.”