InterviewStack.io LogoInterviewStack.io

Error Handling and Defensive Programming Questions

Making code robust against bad input and failure: exceptions versus error returns, input validation, guard clauses, graceful degradation, and designing for the unhappy path. Covers where to handle versus propagate errors and how to fail safely without hiding bugs. A recurring probe of production maturity.

HardTechnical
24 practiced

Design a 60-minute interview exercise focused on error handling and maintainable code for a mid-senior candidate: the prompt, constraints, expected deliverables, and a scoring rubric testing correctness, defensive design, testability, and clarity of error messages. Explain how you'd grade a borderline solution.

EasyTechnical
23 practiced

Explain defensive coding and why it matters for a team you manage. Give three concrete defensive-coding practices you would enforce during pull-request review, and one example where too much defensive code becomes counterproductive (slows delivery without meaningfully reducing risk).

HardTechnical
23 practiced

You are asked to define a company-wide error taxonomy and map each error class to an incident-response playbook and SLA severity. Describe the taxonomy categories you would introduce, how you would operationalize them into alerts, severity levels, and on-call escalation, how you would document residual risks, and how you would train teams to use the taxonomy during on-call rotations.

That is every published Error Handling and Defensive Programming question for Engineering Manager so far. Browse the other topics in this category, or practice this one interactively.