InterviewStack.io LogoInterviewStack.io

Debugging and Systematic Troubleshooting Questions

Diagnosing defects methodically: reproducing failures, forming and testing hypotheses, reading stack traces and logs, bisecting changes, and reasoning about error handling and edge cases. Covers a disciplined root-cause approach that applies from local bugs to production issues, distinct from embedded hardware-level debugging. A universally probed engineering-craft skill.

EasyTechnical
24 practiced

Find and explain the bug in this Python function, then provide a corrected implementation:

python
def append_item(item, lst=[]):
    lst.append(item)
    return lst

# append_item(1) -> [1]
# append_item(2) -> [1, 2]  # unexpected: shared across calls

Explain why the sharing happens and show the safe fix for the default argument.

EasyTechnical
26 practiced

What signals in your logs and metrics would push you to roll back a deployment versus continue debugging the currently deployed version of a service? Give a short rubric you use in production, plus a brief example of applying it.

EasyTechnical
28 practiced

Describe a systematic, repeatable approach you use to troubleshoot an unfamiliar technical problem end to end. Cover how you observe the symptom, form and prioritize hypotheses, gather and interpret evidence such as logs, metrics, and traces, isolate the root cause, implement and validate a fix, and decide when to escalate, roll back, or write up a postmortem.

EasyTechnical
28 practiced

Write a memory-efficient Python function parse_log_counts(file_path, top_n=5) that scans a large server log file, which may be larger than available memory, and returns the top N error types or HTTP status codes by count without loading the whole file into memory. Example lines: 2025-01-01T12:00:00Z INFO request_id=1 status=200 and 2025-01-01T12:00:01Z ERROR request_id=2 status=500 exception=ValueError. Describe edge cases and how your implementation handles gzipped logs and malformed lines.

MediumTechnical
20 practiced

A web service shows high CPU usage but low user-visible latency. Explain the possible causes for this discrepancy, how you would investigate whether the extra CPU is wasted work, background tasks, or a measurement artifact, and what remediation you would propose once you know which it is.

Unlock Full Question Bank

Get access to all 25 Debugging and Systematic Troubleshooting interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.