InterviewStack.io LogoInterviewStack.io

Maintainability and Legacy Code Questions

Covers strategies and principles for evolving codebases safely and keeping them easy to understand and change over time. Topics include design principles such as Single Responsibility, Open Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion, removing duplication, establishing appropriate abstraction boundaries, separation of concerns, identifying and remediating code smells, incremental refactoring approaches, regression risk mitigation via tests and feature toggles, backward compatibility and migration strategies, and prioritizing technical debt reduction. Interviewers assess the candidate ability to plan pragmatic refactors, minimize risk during change, and improve long term health of a codebase.

EasyTechnical
84 practiced
You manage a backlog of technical debt across multiple low-priority SRE services and have limited engineering time. Describe a framework to prioritize which technical debt to address first, including measurable criteria and how to present the trade-offs to product and platform stakeholders.
EasyTechnical
89 practiced
Describe the Open/Closed Principle (OCP) and provide an SRE-focused example: you need to add new remediation strategies to an existing incident-response engine without modifying core evaluation logic. How would you design extensibility while keeping the system stable?
EasyTechnical
131 practiced
Explain the Single Responsibility Principle (SRP) and describe how you would apply it when refactoring a monolithic SRE automation script that currently handles alert parsing, remediation actions, log aggregation, and metrics emission. Identify concrete responsibilities you would separate, the benefits for reliability and testing, and one potential trade-off.
HardTechnical
135 practiced
A configuration key used by many services must be removed. Design a phased removal plan that incorporates code-level shims (fallbacks), automated detection of remaining usages, migration scripts, and a communication plan. Explain how to coordinate teams and enforce removal safely.
EasyTechnical
65 practiced
Explain Liskov Substitution Principle (LSP) in the context of monitoring collectors: suppose you replace an existing collector class with a subclass that adds a new optional metric but changes return semantics for some methods. What problems can violate LSP and how would you avoid them when evolving collectors?

Unlock Full Question Bank

Get access to hundreds of Maintainability and Legacy Code interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.