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.

HardTechnical
0 practiced
Hard technical coding: Write a Python script concept (pseudocode acceptable) that performs automated refactoring across a repository by transforming deprecated API calls of the form `old_logger.log(level, message)` to `new_logger.log(level, message, context={})` using an AST-based approach. Explain how you would test the script and avoid introducing regressions.
MediumTechnical
0 practiced
Medium: How can feature branches and feature toggles be used together to reduce risk during large refactors? Describe workflows, examples of safe patterns, and pitfalls to avoid (for example toggle debt, long-lived toggles, and coupling between toggles and code paths).
MediumSystem Design
0 practiced
Design a simple feature toggle system for server-side toggles to support safe rollouts and refactors. Requirements: fast evaluation (<1ms), consistent behavior per request, support boolean and percentage rollouts, persistence for toggles, and ability to disable toggles quickly. Describe architecture choices, storage options, client APIs, and how you'd test it.
EasyTechnical
0 practiced
You must deliver a small hotfix in a legacy system that has no automated tests and limited understanding of the code. Describe step-by-step how you would reproduce the bug, create a minimal regression test, make a safe change, and deploy with minimal risk. Include contingency steps if you cannot reproduce the bug locally.
MediumTechnical
0 practiced
Scenario: Your team wants to extract parts of a tightly-coupled monolith into separate services over the next 12 months. Describe an incremental migration plan using the strangler fig pattern, including how you would identify service boundaries, keep data consistent, test changes, and limit operational risk during gradual extraction.

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.