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.

MediumTechnical
21 practiced

Find and fix the bug in this JavaScript async function, where a missing await causes unpredictable ordering and errors:

javascript
async function processItems(items, processor) {
  items.forEach(async item => {
    await processor(item);
  });
  console.log('done');
}

Explain the root cause and provide a corrected version that guarantees 'done' prints only after every item has been processed.

EasyTechnical
25 practiced

Given a function that sometimes throws an exception deep inside a library you cannot modify, explain how you would instrument the codebase to capture a stack trace and the relevant contextual variables without changing the library's own code. Describe approaches for at least two of Python, Java, or Node.js.

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
25 practiced

Explain rubber-duck debugging and describe how you would use it collaboratively to help a teammate find a bug they are stuck on. Include when it is appropriate to escalate to active pair programming versus continuing to guide them through the technique.

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.