Legacy Modernization and Architecture Evolution Questions
Evolving an existing system rather than designing greenfield. Covers the modernization patterns (strangler fig, anti-corruption layers, facades and protocol adapters), choosing between rehosting, replatforming, incremental refactoring and a full rewrite, data migration and coexistence (dual-running, change-data-capture versus bulk cutover, reconciliation and drift), cutover readiness and decommissioning, recovering undocumented behavior from legacy code and stored procedures, instrumenting a migration so you can tell in real time whether it is working, and the organizational and risk management of long migrations across many teams. The scope is the migration itself: not quantifying or prioritizing technical debt, not code-level refactoring craft, not how to decompose a system into microservices, and not cloud migration or deployment and rollback mechanics as topics in their own right.
How does Conway's Law show up when you're migrating a system and deciding how to carve it up? When does aligning the new architecture to existing team boundaries help, and when does it lock in a bad design?
Sample Answer
Direct answer
Conway's Law says a system's architecture ends up mirroring the communication structure of the organization that builds it, and during a migration that cuts both ways: aligning new service boundaries to existing team boundaries accelerates the migration because ownership and decision-making stay clear, but it locks in whatever boundaries the org happens to have today, which may not be the technically sound ones if the org structure itself grew for historical or political reasons rather than around the actual domain.
Structured elaboration
When alignment helps: if a team already owns a coherent piece of business capability and communicates efficiently internally, extracting a service along that exact boundary means the people best positioned to understand its behavior are the ones building and owning it, decisions can be made quickly without cross-team negotiation, and the resulting service boundary has a natural, sustainable owner from day one. This is usually the fastest path during an active migration, because you're not fighting the org's existing communication patterns.
When it creates suboptimal boundaries: if the org structure predates the domain understanding you have now (teams split by historical accident, by who was hired first, or by a previous reorg that no longer reflects how the business actually works), forcing the new architecture to match that structure bakes a bad boundary into the system for the sake of migration speed. A classic version: a team owns "everything related to orders" because that's how the org chart happened to be drawn years ago, even though order creation and order fulfillment are genuinely separate domains with different scaling and consistency needs, and splitting them would produce a better architecture at the cost of also having to split (or renegotiate) team ownership.
Governance and organizational techniques to balance this:
- Decide the target service boundaries from the domain first, independent of current team structure, then explicitly evaluate the gap between that target and the org's current shape, rather than letting the current org shape silently define the target.
- Where the gap is small, align and move fast. Where it's large, make a deliberate call: either accept a suboptimal near-term boundary to keep the migration moving and plan to fix it later (a real cost, since re-splitting a service after the fact is its own migration), or invest in the reorg alongside the technical migration, accepting it will be slower.
- Use a cross-functional architecture review (not owned by any single team) to catch the case where a proposed service boundary looks convenient for the current org chart but doesn't hold up as a coherent domain boundary, before it's built and becomes expensive to undo.
Worked example
A team migrating an e-commerce monolith discovers that "the orders team" currently owns order creation, payment processing, and fulfillment tracking, three domains that grew together historically because one early engineer built all of it. Aligning the new service boundaries to this existing team would mean one large "orders service" doing all three, fast to build because ownership is unambiguous, but it recreates a version of the same coupling problem the migration was meant to solve, since payment processing has very different compliance and scaling needs than fulfillment tracking.
The team instead decides the domain-correct boundary is three separate services, and explicitly plans the organizational change alongside the technical one: the orders team splits into two teams (payments, and order-and-fulfillment) over the following two quarters, with the split sequenced to match which service gets extracted first, so a team never owns a service that doesn't exist yet, and the migration and the reorg reinforce each other rather than one blocking the other.
Trade-offs and pitfalls
The trade-off is migration speed against long-term architectural soundness: aligning to the current org is almost always faster in the near term, and for many boundaries that's a perfectly reasonable trade to make deliberately. The pitfall is making that trade unconsciously, letting the org chart silently define the architecture without ever asking whether it's actually the right domain boundary, which is exactly how Conway's Law produces an architecture nobody consciously designed.
You're migrating a revenue-critical system (billing or similar) where a mistake means real money lost, not just an outage. How would you run the two systems in parallel and prove the new one is right before you let it take over?
Sample Answer
Direct answer
Migrating something revenue-critical safely means never trusting the new system with real money until it has proven, through a real parallel run against production traffic, that it produces the same result as the system you already trust. The plan runs both systems on the same inputs, reconciles their outputs continuously, and only lets the new system's result become authoritative once reconciliation has been clean for long enough, with a clear process for handling the disputes that will inevitably surface along the way.
Structured elaboration
- Parallel-run architecture: both the legacy and new systems process the same real transactions, but only the legacy system's result is authoritative and drives real customer-facing outcomes (a bill sent, a payment charged). The new system runs in shadow, computing its own result for comparison without it affecting anything real.
- Reconciliation, continuous and automated: compare legacy and new outputs for every transaction (or a defined complete subset, if volume makes 100% comparison impractical), flagging any discrepancy immediately rather than in a batch review days later. For a system with legal and financial constraints, "no revenue loss" needs to be a measurable property of this reconciliation, not an assumption.
- Dispute handling: some discrepancies will be genuine bugs in the new system; others might reveal that the legacy system itself has a known quirk the new system correctly doesn't replicate, forcing an actual decision about which behavior is "correct" going forward, one that may need a business, not just an engineering, answer. This needs an explicit triage process, not an ad hoc one, given how consequential misclassifying a discrepancy could be.
- Cutover gating criteria: define in advance what "clean enough" means, zero discrepancies for a minimum period, or a discrepancy rate below an agreed threshold with each one explained, and don't let schedule pressure quietly lower that bar as a deadline approaches.
- Rollback triggers: even after cutover, keep the ability to fall back to the legacy system's authority if a problem surfaces that parallel-run testing didn't catch, since parallel-run reduces this risk but cannot eliminate it entirely.
Feature toggles, canary rollout by transaction type or customer segment, and full data-migration discipline (dual-writes with reconciliation) are the same underlying tools applied here with financial stakes raising the bar for how rigorously they're executed and how long the parallel-run period needs to run before anyone trusts the result.
Worked example
Migrating a billing monolith with near-zero downtime tolerance:
- Risk assessment identifies the highest-risk modules (anything touching invoice calculation and payment triggering) versus lower-risk ones (invoice formatting, notification text), and the migration sequences lower-risk modules first, following strangler-pattern discipline, to build confidence in the approach before touching the highest-stakes logic.
- Parallel run: for each module as it's extracted, the new implementation computes its result for every real transaction, and it's compared against the legacy result, with any mismatch logged with full transaction context for investigation, before that module's output is trusted for any real customer.
- Feature toggles and canarying: once a module's parallel-run reconciliation has been clean for an agreed period (say, two full billing cycles for a monthly-billing system, since that's the natural unit that would surface a periodic bug a shorter window would miss), the toggle shifts a small percentage of real transactions to the new module's output, ramping gradually while reconciliation continues in the background even for the traffic still on the legacy path.
- Metrics that determine readiness to cut over each module: zero unexplained discrepancies over the full billing cycle, explained discrepancies resolved with an explicit decision on which behavior is correct, and no open incidents tied to the module in the preceding cutover window.
- Rollback and DR: even post-cutover, the legacy calculation path remains callable for a defined grace period, so if a rare edge case surfaces after full cutover, the team can fall back rather than having destroyed the only system that could confirm the right answer.
Trade-offs and pitfalls
The trade-off is time against certainty, at the scale a revenue-critical migration demands, a full billing cycle or more per module for parallel-run confidence is a real cost, but it's small compared to the cost of a billing error affecting real customers and real revenue. The pitfall that shows up under schedule pressure is quietly shortening the reconciliation window or lowering the "clean enough" bar as a deadline approaches, exactly the discipline the plan is designed to protect, and exactly the discipline that erodes fastest when a deadline is looming.
Some steps in a migration cannot be undone once taken (an irreversible data transformation, a format change that downstream systems have already consumed). How do you design a rollback strategy when the obvious rollback, undo the change, is not available to you?
Sample Answer
Direct answer
When the obvious rollback (undo the change) isn't available because the transformation destroyed information or downstream systems have already consumed the new state, the fallback strategy has to be designed in ahead of time: keep enough versioned or shadow data to reconstruct the prior state, use compensating actions rather than a literal undo, and treat communication with anyone who already consumed the bad state as part of the rollback, not an afterthought.
Structured elaboration
The techniques, and when each applies:
- Versioned data and shadow writes. Instead of transforming data in place, write the new version alongside the old (a new column, a new table, a snapshot) so the pre-transformation state still exists somewhere, even if the "live" path has moved on. This turns an apparently-irreversible transformation into a reversible one, at the cost of extra storage and the discipline to actually keep the old version around long enough to matter.
- Event-sourcing and replay. If the system's state is derived from an append-only log of events rather than stored as a mutable snapshot, "rolling back" an irreversible-seeming transformation can mean replaying the log up to before the transformation and rebuilding state from there, rather than trying to invert the transformation itself.
- Snapshotting before the irreversible step. For a one-time, high-risk transformation (a denormalization, an encryption-format change), take an explicit, verified snapshot immediately before it runs, so "rollback" means restoring the snapshot rather than inventing an inverse of a lossy operation on the fly, which is often mathematically impossible (you cannot always reverse a lossy denormalization, for instance).
- Compensating actions for downstream-consumed state. If a schema change is irreversible and downstream analytics has already consumed the transformed data, a literal rollback of the source doesn't undo what downstream already computed from it. The fallback here is a compensating job: reprocess or correct the downstream-derived results, and communicate to downstream teams what happened and what they need to reconcile on their end, rather than pretending a source-side rollback alone fixes the problem.
- Feature toggles as a stop-loss, not a full rollback. Even when full data rollback isn't feasible, a toggle that stops the irreversible process from proceeding further limits how much additional damage accumulates while you execute the real recovery plan.
Worked example
A team runs an encryption-format change on a large customer-data table, migrating from one encryption scheme to another. Partway through, they discover a bug: a subset of records were encrypted with the wrong key, and by the time this is caught, downstream analytics jobs have already run against (and cached results from) the corrupted subset.
- Because they took a verified snapshot immediately before the migration started (a deliberate step in the runbook, not an afterthought), they can restore the affected subset of records from that snapshot rather than attempting to somehow decrypt the wrongly-encrypted data, which may not even be mathematically possible depending on the specific bug.
- For the downstream analytics jobs that already consumed the corrupted data, a compensating job identifies which cached results were derived from the affected records and reruns just those computations against the restored, correct data, rather than a full reprocessing of everything.
- Communication with downstream teams happens before the compensating job even finishes: teams are told which specific date ranges and record sets were affected, so they can independently flag any manual analysis or reports they'd already produced from the bad data, something an automated compensating job for their systems specifically cannot fully cover on its own.
Trade-offs and pitfalls
The trade-off is cost paid up front (snapshotting, shadow writes, versioning) against the cost of having no path back later; skipping this discipline because a transformation "should" work fine is exactly how teams end up in the position of an irreversible mistake with genuinely no recovery path, since by definition you cannot add a snapshot after the fact for data that's already been transformed and the original discarded. The pitfall in the compensating-action approach specifically is treating the source-side fix as the whole rollback and forgetting that anything downstream which already consumed the bad state needs its own explicit correction, not just an assumption that fixing the source retroactively fixes everything derived from it.
Design a decommissioning plan for shutting down a legacy system after its replacement has taken over. What has to be true before you actually delete anything?
Sample Answer
Direct answer
Before you delete anything, you need proof the migration actually succeeded (not just that the new system is live), a defined retention and archival plan for whatever legal or audit obligations outlive the system itself, a rollback path in case something surfaces after decommission that the pre-cutover testing missed, and a communication plan that reaches every stakeholder who might still depend on the old system, including the ones you do not already know about.
Structured elaboration
A decommissioning plan has four parts, and skipping any of them is how "the migration is done" turns into "we deleted data we needed":
- Verification that the migration is actually complete. Not "the new system works," but "nothing depends on the old one anymore." This means auditing traffic and access logs on the legacy system for weeks after the cutover, not just at the moment of cutover, because low-frequency dependencies (a monthly batch job, a quarterly report) will not show up in a one-week traffic sample.
- Legal and audit retention requirements. Many systems have data that has to remain queryable for years after the system itself is gone, for regulatory or contractual reasons. That means an archival strategy decided before decommission, not scrambled together after someone asks for five-year-old records the week after you deleted the database.
- A rollback plan for the decommission itself, distinct from the rollback plan for the original migration. If something surfaces after you have shut the legacy system down (a caller nobody knew about, a data discrepancy only visible under a rare condition), you need a defined path back, even if that path is "restore from the last verified backup and re-enable the legacy code path for a bounded window," not "we have no idea, we deleted it."
- Third-party integrations and stakeholder communication. External partners often integrate with systems in ways your internal traffic logs cannot see (a partner polling an API you exposed to them specifically). The communication plan needs to reach them with enough lead time to migrate on their side, not just notify internal teams.
Worked example
A team decommissioning a legacy order-management system after a successful migration:
- They keep the legacy system read-only (not deleted) for 90 days post-cutover, monitoring access logs the whole time. In week six, they find a quarterly compliance report job still reading directly from the legacy database, which nobody had flagged as a dependency because it only runs four times a year.
- They export the full historical dataset to a queryable archive with a retention period matching the company's seven-year audit requirement, and verify a sample of archived records against the live system before the live system goes away, since an archive nobody has tested is not actually a safety net.
- They notify the three external partners who integrate with the legacy system's API directly, giving them 60 days' notice and a migration guide, rather than assuming internal migration alone covers everyone with a dependency.
- Only after all of this, and after a final confirmed zero-traffic week on the legacy system, do they actually shut it down, with the archived data and a documented restore procedure kept in case something surfaces later.
Trade-offs and pitfalls
The tempting shortcut is to declare victory the moment the new system handles 100% of live traffic and decommission immediately, but "no traffic this week" is not the same as "no dependencies," and the cost of being wrong (deleted data you needed, a partner integration silently broken) is far higher than the cost of a monitored grace period before deletion. The other common mistake is treating archival as a technical afterthought rather than a compliance requirement with its own sign-off, which is how companies end up unable to produce records a regulator or auditor asks for.
You need to retire a legacy system that still has to satisfy a regulator's audit requirements after it is gone. How does that change the decommissioning plan?
Sample Answer
Direct answer
Retiring a legacy system that still owes a regulator queryable audit trails turns the decommission plan inside out: instead of "shut it down once nothing depends on it," the plan has to prove the data will remain accessible and trustworthy for as long as the retention requirement demands, which usually means extracting the data into a format you actually understand before you lose the only system that can read it.
Structured elaboration
The added steps, on top of an ordinary decommission:
- Data discovery. Before anything else, catalog exactly what audit-relevant data exists, where it lives, and in what proprietary binary format. Legacy systems often have data whose structure lives only in the application code itself, so this step usually requires reverse-engineering the format from the code or from a vendor's (possibly outdated) documentation.
- Format reverse-engineering. Determine the byte-level or record-level structure well enough to write a reliable extractor. This is genuinely risky work: get a field's meaning wrong and you silently corrupt audit records instead of failing loudly, so it needs to be paired with extensive spot-checking against known-good records before it's trusted.
- Extraction and validation. Extract the data into an open, durable format (not another proprietary one), and validate the extraction with checksums and statistical sampling against the original system while the original system is still available to compare against, since that comparison becomes impossible the moment the legacy system is gone.
- Secure archival. Store the extracted data with the access controls, encryption, and retention timers the regulation demands, and make sure the archive itself is queryable, not just stored, since "we have the bytes on a tape somewhere" does not satisfy an audit request with a reasonable response time.
- Compliance sign-off. Get explicit sign-off from whoever owns regulatory risk that the archive satisfies the retention and query requirements, before decommissioning, not as a formality after the fact.
- Auditor access. Build (or buy) a way for auditors to actually query the archived data in the format and timeframe they are entitled to, which is a real deliverable, not just "the data technically exists somewhere."
Worked example
A team retiring a 20-year-old trading system with regulator-mandated seven-year audit trail retention, stored in a proprietary binary transaction log format:
- They pull the original system's source code and existing (partial, outdated) format documentation, and reverse-engineer the record layout by cross-referencing known transactions against their known real-world outcomes, confirming field offsets and types.
- They write an extractor, run it against the full historical log, and validate a statistically significant sample of extracted records against the live system's own reporting output (which they trust, because it is what regulators have been accepting for years), catching two field-mapping errors during this step that would have silently corrupted a subset of records.
- They load the validated extraction into a modern, queryable archive with immutable storage and access logging, matching the seven-year retention window and adding two years of margin.
- Legal and compliance sign off that the archive satisfies the retention requirement and that auditors can be given time-bounded read access on request.
- Only then do they decommission the legacy trading system itself, keeping the original binary logs in cold storage as a last-resort fallback in case a discrepancy is ever found in the extracted archive.
Trade-offs and pitfalls
The core risk is silent corruption: a wrong assumption during format reverse-engineering does not crash, it just produces a plausible-looking but wrong audit record, which is far worse than an obvious failure because nobody notices until an audit surfaces the discrepancy years later, possibly after the legacy system that could have confirmed the right answer is long gone. That is why validation against the live system, while it is still live, is not an optional step, it is the only point in the whole process where you can actually catch this class of error.
Unlock Full Question Bank
Get access to all 31 Legacy Modernization and Architecture Evolution interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.