Vanta·Software Engineer·Technical Phone Screen
- Design and implement an in-memory service that logs test run results with a log(test_id, timestamp, status) function, where status is either 'pass' or 'fail', and events arrive with strictly increasing timestamps across all test IDs.
- Implement getMinPassTransition(test_id): return the minimum elapsed time for a test to go from failing to passing, where consecutive fail reports count as a single failure segment starting at the first fail. Return null if no complete fail-to-pass transition exists.
- Add a getMaxConcurrentFailures(min_tests) function that finds the longest contiguous time interval during which at least min_tests distinct tests are failing simultaneously. Return an object with inclusive start and exclusive end timestamps, or null if no such interval exists. How do you handle tie-breaking and what are the complexity implications?
“The logging part itself was fine.”