InterviewStack.io LogoInterviewStack.io

Debugging and Recovery Under Pressure Questions

Covers systematic approaches to finding and fixing bugs during time pressured situations such as interviews, plus techniques for verifying correctness and recovering gracefully when an initial approach fails. Topics include reproducing the failure, isolating the minimal failing case, stepping through logic mentally or with print statements, and using binary search or divide and conquer to narrow the fault. Emphasize careful assumption checking, invariant validation, and common error classes such as off by one, null or boundary conditions, integer overflow, and index errors. Verification practices include creating and running representative test cases: normal inputs, edge cases, empty and single element inputs, duplicates, boundary values, large inputs, and randomized or stress tests when feasible. Time management and recovery strategies are covered: prioritize the smallest fix that restores correctness, preserve working state, revert to a simpler correct solution if necessary, communicate reasoning aloud, avoid blind or random edits, and demonstrate calm, structured troubleshooting rather than panic. The goal is to show rigorous debugging methodology, build trust in the final solution through targeted verification, and display resilience and recovery strategy under interview pressure.

HardTechnical
86 practiced
You are debugging a nondeterministic divergence that happens only under Distributed Data Parallel (DDP) across nodes. Propose a prioritized experiment plan to isolate whether the cause is data inconsistency, RNG/seed problems, NCCL misconfiguration, optimizer state synchronization, or a hardware issue. Include quick commands and tools you would use.
HardTechnical
72 practiced
Case study: a model trained on synthetic data performs well in validation but fails catastrophically in real deployment. You have a 2-hour window to run forensic analysis. Outline the steps you would take to isolate the sim-to-real gap causes (e.g., sensor differences, label mismatch, preproc differences), rapid experiments to test hypotheses, and immediate mitigations to restore functionality.
MediumTechnical
85 practiced
A multithreaded Python data loader produces deterministic shuffling (same order every epoch) causing training issues. Given this snippet, identify the likely bug and propose a fix and a test to verify shuffling randomness across workers:
python
def init_worker(seed):
    random.seed(seed)

for epoch in range(epochs):
    random.seed(42)
    sampler.shuffle()
    # start workers that call init_worker(42)
Explain proper seed handling for workers.
HardTechnical
64 practiced
Implement a Python utility that finds the smallest batch size that causes model outputs to contain NaN values. The function signature is:
python
def find_nan_batch_size(run_fn, min_bs=1, max_bs=1024, retries=2):
    """run_fn(batch_size) -> True if run succeeded without NaN, False otherwise"""
Return the minimal batch size that causes NaN or None if none found. Consider flaky runs, timeouts, and efficiency (use exponential + binary search). Provide robust code.
EasyTechnical
68 practiced
You have an LRU cache implementation used to memoize model inference results. It does not evict items correctly when capacity is reached. Without writing full code, describe the typical mistakes that cause incorrect eviction behavior, how you'd reproduce the issue quickly, and minimal unit tests you'd add to fix and prevent regressions.

Unlock Full Question Bank

Get access to hundreds of Debugging and Recovery Under Pressure interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.