InterviewStack.io LogoInterviewStack.io

Clean Code, Refactoring, and Maintainability Questions

Writing code that other people can read, change, and keep alive over time: naming, function and module decomposition, avoiding duplication, readability, disciplined use of language idioms and design patterns, and recognizing code smells, extending into working effectively in large, aging, or unfamiliar codebases through safe incremental change, refactoring under test coverage, and managing technical debt. Covers both authoring professional-grade code beyond mere correctness and improving code you cannot rewrite without breaking it. Spans the coding-round quality signal and the seniority signal of leaving a codebase healthier than you found it.

MediumSystem Design
28 practiced

Explain the Strangler Fig pattern for retiring a legacy system incrementally. Walk through applying it to extract a single business capability out of a monolith into a new service, one seam at a time, while the old and new paths coexist.

HardTechnical
27 practiced

Define a robust error-handling and escalation policy for production data pipelines. Classify transient errors (retry), data-validation failures (dead-letter), and infrastructure failures (alerts and runbooks). Explain how you would implement these classifications in code, how you would surface rich context in alerts, and how you would ensure the operational runbooks are discoverable and linked from the alerts themselves.

MediumTechnical
52 practiced

Describe a defensive-programming strategy to detect and handle schema drift for JSON records arriving in a streaming pipeline. Include which runtime checks you would implement (field presence, types, unexpected fields), when you would fail fast versus degrade gracefully, and how you would surface schema issues to monitoring and alerts without overwhelming the team with noisy spikes.

MediumTechnical
35 practiced

What is idempotency in the context of ETL and data pipelines? Give two concrete strategies to make a batch job idempotent, for example file-based output versus a database upsert, explain how each strategy achieves idempotency, and discuss the trade-offs. Then extend this to a distributed streaming system with at-least-once delivery, where multiple retries can create duplicate downstream writes: design a robust approach to deduplicated writes that accounts for idempotent keys, transaction support, late arrivals, and eventual compaction, and describe the trade-offs and failure modes.

MediumTechnical
28 practiced

Describe a real situation where you accepted a more complex, less readable implementation for a genuine performance gain. How did you document the trade-off in the code itself so a future reader (including you) understands why the 'ugly' version is there on purpose?

Unlock Full Question Bank

Get access to all 19 Clean Code, Refactoring, and Maintainability interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.