Roll Up Hourly Test Results Into Per-Control Status

Last updated: November 29, 2026

Quick Overview

Given a mapping from automated tests to the compliance controls they support and the latest result of each test, compute a status for every control: failing if any mapped test fails, needs attention if any test has no usable result, otherwise passing.

Vanta
Coding & Algorithms
Software Engineer
Vanta
November 29, 2026
Software Engineer
Phone Screen
Coding & Algorithms
Easy

0

0

0 solved


Given a mapping from automated tests to the compliance controls they support and the latest result of each test, compute a status for every control: failing if any mapped test fails, needs attention if any test has no usable result, otherwise passing.

Vanta's product is built on tests that run against customer integrations and roll up into controls, which then roll up into frameworks like SOC 2. This warm-up checks that a candidate can invert a many-to-many mapping cleanly and make sensible decisions about missing data instead of silently treating it as a pass.

What the Interviewer Expects
  • Inverts the test to controls mapping into controls to tests
  • Defines precedence: fail beats unknown beats pass
  • Treats a missing or errored result as not proven, never as passing
  • Returns the offending test ids so a user can act
  • States O(total mappings) complexity
Key Topics to Cover
hash maps
many-to-many mapping
status precedence
missing data handling
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you add a 'not applicable' state that a customer can set on a test?
  • What changes if a control requires only one of several alternative tests to pass?
  • How would you roll control status up to a framework percentage?
  • How would you make this incremental when only one test result changes?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Input: test_to_controls such as {"mfa": ["AC-1", "AC-2"]} and results such as {"mfa": "pass"}. Output: for each control, a status and the list of tests that explain it. A test with no result (...

High-Level Design

Invert the mapping once into control -> [tests]. Then for each control, scan its tests and classify. Precedence is failing > needs_attention > passing so the most actionable state wins, and we ret...


Submit Your Answer
Markdown supported

Related Questions