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
0 practiced
What are characterization tests? As an SRE working with legacy automation code with no tests, explain how you'd write characterization tests to capture current behavior before refactoring. Describe one pattern for capturing behavior without changing production code.
HardSystem Design
0 practiced
Design a strategy to refactor a data-access layer in a multi-region service so reads are region-local while maintaining a single logical API for clients. Discuss abstraction boundaries, consistency models, fallbacks, and how to roll out changes without breaking clients.
HardTechnical
0 practiced
You're asked to lead a cross-team refactor of a widely used shared library. Describe how you would organize the effort: governance, migration windows, communication plan, owning a deprecation policy, CI safety nets, and assessment of SLO impact across consumers.
HardTechnical
0 practiced
A team proposes rewriting a critical SRE component from scratch because it is messy. As a senior SRE, describe how you would evaluate rewrite vs incremental refactor. Outline decision criteria (risk, time, maintenance cost, domain knowledge), estimation approach, and a recommended course of action.
MediumTechnical
0 practiced
Implement a minimal, thread-safe feature toggle library in Python that supports boolean toggles, percentage rollouts, and runtime overrides. Describe the public API, how toggles are evaluated at runtime, and how you would unit test rollouts deterministically. You do not need to provide full code but specify interfaces and concurrency considerations.

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.