Shrink a Crashing Input to a Minimal Reproducer With Delta Debugging

Last updated: November 29, 2026

Quick Overview

A parser crashes on a 50 KB HTML document from a crawl. Given a black-box function that reports whether an input still triggers the crash, write an algorithm that reduces the input to a small failing case in which removing any single element makes the crash disappear.

Google
Software Engineering Fundamentals
Software Engineer
Google
November 29, 2026
Software Engineer
Onsite
Software Engineering Fundamentals
Hard

0

0

0 solved


A parser crashes on a 50 KB HTML document from a crawl. Given a black-box function that reports whether an input still triggers the crash, write an algorithm that reduces the input to a small failing case in which removing any single element makes the crash disappear.

Google's crawler and fuzzing infrastructure (OSS-Fuzz, ClusterFuzz) automatically minimize crashing inputs before filing bugs. An onsite fundamentals round may ask for this to see systematic debugging thinking, a correct divide-and-refine loop, and reasoning about the cost of each test call.

What the Interviewer Expects
  • Defines the goal as a 1-minimal failing input and explains why global minimality is too expensive
  • Tries subsets and complements at increasing granularity
  • Resets granularity after a successful reduction
  • Treats the failure predicate as expensive and counts calls
  • Discusses flaky predicates and determinism requirements
Key Topics to Cover
delta debugging
test case reduction
debugging
divide and conquer
fuzzing
How to Approach This
  1. Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
  2. Choose data structures based on access patterns, not familiarity.
  3. Prefer immutable data and message passing over shared mutable state for concurrency.
  4. Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
  • What if the crash is nondeterministic?
  • How would you reduce structured inputs like HTML trees rather than characters?
  • How can you cache predicate results to avoid repeated runs?
  • How would you parallelize the subset tests?
Sharpen Your Skills on Codemia

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

Practice System Design Problems
Sample Answer
Requirements
  • Input: a sequence (string or list) that fails and a predicate fails(seq).
  • Output: a failing subsequence such that deleting any single element passes.
  • Minimize predicate calls since each may ru...
High-Level Design

Split the input into n chunks (start with 2). If any chunk alone still fails, recurse on it with n = 2. Otherwise, try each complement (the input with one chunk removed); if one fails, keep it and...


Submit Your Answer
Markdown supported