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
Explain the principle of 'separation of concerns' in the context of a typical web server application where routing, request parsing, business logic, and storage are mixed in single classes. Show how you would separate these concerns into layers or components and the benefits this brings to maintainability and testing.
HardTechnical
0 practiced
Problem solving (hard): You need to change a public HTTP API used by many external clients. How do you minimize regression risk during the change? Describe a plan covering API versioning, deprecation policy, adapters/proxies, semantic versioning, contract tests, documentation, and rollout steps including canarying and monitoring.
MediumTechnical
0 practiced
Problem solving (medium): How do you write deterministic unit tests for code that depends on system time and environment variables? Describe techniques to avoid flakiness such as dependency injection of clocks/config, use of fixtures, and strategies for isolating environment differences in CI.
HardTechnical
0 practiced
Scenario (hard): You discover a global mutable singleton used throughout a C++ codebase that causes intermittent race conditions in production. Propose a stepwise migration strategy to remove the global while preserving behavior. Consider unit/integration testing, instrumentation to detect regressions, incremental rollouts, and performance implications.
HardTechnical
0 practiced
Leadership (hard): You are responsible for a cross-team initiative to reduce technical debt over 12 months. Draft a high-level roadmap that includes goals, quarterly milestones, staffing needs, how to allocate engineering capacity, metrics to track progress, communication plan with stakeholders, and how to handle emergency feature requests that conflict with the plan.

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.