Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Automating Vulnerability Detection

MediumPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Automating Vulnerability Detection. Start with the requirements on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Tell me about a time you built automation to detect vulnerabilities at scale.

Implement find_unique_vulnerabilities(findings) as a compact coding exercise. Each finding is [asset_id, vulnerability_id, severity, timestamp]. Return one finding per (asset_id, vulnerability_id), keeping the highest severity and, among equal severities, the earliest timestamp. Sort the result by asset_id, then vulnerability_id.

Constraints

  • 0 <= findings.length <= 10^4
  • Each finding contains exactly four values: asset_id, vulnerability_id, severity, and timestamp
  • asset_id and vulnerability_id are non-empty strings
  • severity is one of: low, medium, high, critical
  • timestamp is an integer
  • The output must contain at most one record for each asset and vulnerability pair

Function Signature

def find_unique_vulnerabilities(findings):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output