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.

HardSystem Design
65 practiced
Explain how to introduce consumer-driven contract testing between frontend and backend teams to reduce regressions during incremental refactors. Describe tooling choices, test ownership (who writes/maintains contracts), how to store and version contracts, how to run them in CI, and strategies for handling backward-compatible changes.
EasyTechnical
77 practiced
Explain how adopting TypeScript (gradually) improves maintainability of a legacy JavaScript frontend. Include examples of type-safety preventing common refactor bugs, how types assist IDE refactors, and pitfalls to watch for during an incremental migration.
MediumSystem Design
69 practiced
Design a plugin architecture for extensible UI widgets so new behaviors can be added without modifying existing widget core. Explain extension points, how plugins should register, how to validate/secure plugins, how to manage lifecycle and performance costs, and how to avoid breaking backward compatibility as plugins evolve.
EasyTechnical
61 practiced
Identify duplication in the CSS below and propose a maintainable refactor using variables, utility classes, or component-scoped styles. Explain why your approach reduces cognitive load and prevents visual regressions.
css
.card-title { font-size: 16px; color: #333; margin-bottom: 8px; }
.product-title { font-size: 16px; color: #333; margin-bottom: 8px; }
.notification-title { font-size: 16px; color: #333; margin-bottom: 8px; }
HardTechnical
60 practiced
Your legacy SSR web application has grown a large client bundle. Propose a plan to reduce client bundle size using code-splitting, dynamic imports, tree-shaking, and dependency analysis while preserving SSR and hydration stability. Explain pitfalls (e.g., mismatched markup, loading race conditions) and how to test that hydration remains correct across split points.

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.