📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

📚 Interview question

The business asks whether to rewrite a large, ageing .NET Framework system from scratch or modernise it incrementally. How do you make the business case: what do you analyse, how do you estimate each option, what risks do you put in front of the executives, and how do you decide? When is a rewrite actually the right call?

Staff-level decision on rewrite versus incremental modernisation: assessing the system (value, change rate, quality, knowledge), the hidden costs of rewrites (second-system effect, feature parity, frozen delivery), estimating options with ranges, a decision matrix including retain and replace-with-SaaS, presenting risk to executives, and when a rewrite is justified.

Staff / Architect Architecture Expert architecture-decisions business-case estimation legacy-migration modernisation rewrite-vs-refactor

🎯 Key points

  • Frame options as a portfolio: retain, rehost, incremental modernisation, rewrite, replace with SaaS, retire
  • Assess each module on value (revenue or cost it supports, users, regulatory need), change frequency (git history), technical health (defects, incidents) and how well it is understood
  • Rewrites are underestimated because the old code holds implicit rules, the old system keeps changing, and parity work is invisible until UAT
  • Estimate with P50/P90 ranges using reference-class data (past projects), re-estimating after each delivered slice
  • Incremental lowers risk by delivering value early and allowing stop points; it costs more coordination and longer dual running
  • Rewrite is right when the system is small, the domain has changed radically, or the platform is a true dead end; even then, slice by slice
  • Present risk as cost of delay, probability of overrun and reversibility, with stop/go decision gates
  • Record the decision in an ADR with the assumptions that would change it

⏱ 30-second answer

I treat it as an investment decision, not a technical preference. I assess the system module by module on business value, change frequency, technical health and how well the behaviour is understood, then compare a portfolio of options: retain, rehost, incremental modernisation, rewrite, replace with SaaS, or retire.

Rewrites look clean but carry hidden costs: undocumented requirements, a long chase for feature parity, frozen delivery and double running, and they are routinely underestimated. Incremental modernisation delivers value early and has stop points, at the cost of coordination and longer dual running. A rewrite is right when the system is small, the domain has fundamentally changed, or the platform is a true dead end. I present estimates as ranges, with cost of delay and decision gates. The trade-off is certainty of progress versus the appeal of a clean slate.

🗣 Full answer (senior)

How I would answer this in an interview

"I start by refusing the binary. 'Rewrite or refactor' hides at least six options: retain as is, rehost to cheaper infrastructure, modernise incrementally, rewrite, replace with a SaaS product, or retire it. And the answer is rarely the same for the whole system, so I assess it module by module on four things: business value, how often it changes, technical health (test coverage, defect rate, how scary deployments are), and how well we understand its behaviour. A stable, rarely changed billing module and a fast-changing pricing engine deserve different decisions.

Then I estimate each viable option with ranges and confidence, not single numbers, and I'm explicit about what rewrites usually miss: the hundreds of implicit rules in the old code, the months spent chasing parity, the cost of running both systems, and the feature freeze the business will hate. Reference-class data helps here: most large rewrites overrun badly. For example, at [company] I [prepared a rewrite-vs-modernise case for a system of about N modules]; we [chose incremental for most modules and a rewrite for one], and [result].

When I present to executives, I talk about cost of delay, the probability of overrun, and reversibility. Incremental has early value and stop points: if funding is cut after six months, we still have something better. A rewrite has value at the end and nothing before. The mistake I see is engineers selling a rewrite because the code is unpleasant to work in; that's a real cost, but it has to be weighed against the risk. A rewrite is right when the system is small, the domain has changed so much that the old model is wrong, or the platform is a genuine dead end. I record the decision in an ADR, including what would make us revisit it."


The options

Option When it fits Typical cost Main risk
Retain (stay on .NET Framework 4.8.1) Stable, low change, still supported Low Skills and talent drain, security posture
Rehost (lift and shift to Azure VMs) Data-centre exit deadline Low–medium Moves the problem, few benefits
Incremental modernisation Valuable, actively changed, large Medium–high, spread out Long dual running, coordination
Rewrite Small, or domain radically changed, or dead-end platform High, up front Parity chase, overrun, frozen delivery
Replace with SaaS Commodity capability (CRM, HR, payroll) Licence + integration Fit, lock-in, customisation
Retire Low value, few users Low Hidden dependents

Assessment per module

Module Value Change rate Health Understood? Leaning
Pricing engine High Weekly Poor Partly Incremental, with characterisation tests
Billing High Yearly OK Yes Retain, extract later
Reporting Medium Monthly Poor Yes Replace with Power BI
Legacy fax gateway Low Never Poor No Retire

Production example

For a 1.2 million-line .NET Framework system, the team proposed an 18-month rewrite. The assessment found 30% of the code unused, reporting replaceable with Power BI, and only the pricing engine both high-change and unhealthy. The agreed plan modernised pricing incrementally, retired two modules and kept billing on 4.8.1; the first modernised slice shipped in seven weeks, and the total spend was about 40% of the rewrite estimate.

🔍 What the interviewer is checking

Checks staff-level judgement: framing a high-stakes technical decision as a business investment, estimating honestly and knowing when a rewrite is really justified.

Green flags

  • Breaks the binary into a portfolio of options and decides per module
  • Names the hidden costs of rewrites and uses ranges with reference-class data
  • Talks about cost of delay, reversibility and decision gates
  • Can name when a rewrite is right

Red flags

  • Dogmatic either way ('always rewrite' / 'never rewrite')
  • Single-point estimates
  • Argues only from code quality, not business value

📚 Learn in depth

1. Why rewrites fail so often

Rewrite timeline
month 0  ---- spec from old system (incomplete: implicit rules) ----
month 6  ---- old system keeps changing: new target moves ----
month 12 ---- parity gap discovered in UAT ----
month 18 ---- planned go-live; real go-live month 26+ ----
value delivered before go-live: ~0

The old code is the specification, including bug-compatible behaviour customers rely on. Joel Spolsky's 'things you should never do' and Fred Brooks's second-system effect describe the same trap: the new system tries to fix everything at once.

2. Why incremental is usually safer

Incremental modernisation (strangler fig, branch by abstraction, module extraction) delivers working software throughout, keeps the old system as a fallback, and creates natural stop points. Its costs are real: a proxy layer, shared auth and data, two stacks for a while, and the discipline to actually finish (decommissioning).

3. Estimating

  • Use ranges (P50/P90) and state confidence.
  • Use reference-class forecasting: how long did similar migrations take here or elsewhere?
  • Estimate parity work explicitly: count screens, reports, integrations, batch jobs and business rules.
  • Include dual-running cost and cost of delay (features not built while the team migrates).
  • For incremental, estimate the first three slices in detail and the rest by size class; re-estimate after each slice.

4. A simple decision model

score per option = value delivered over time
                 - (build cost + dual-running cost + cost of delay)
                 adjusted by probability of overrun and reversibility

It doesn't need to be precise; it needs to make the assumptions visible so executives can challenge them.

5. When a rewrite is justified

  • The system is small (weeks, not years, to rebuild) and well tested or well understood.
  • The domain has changed so much that the old model is wrong, not just old.
  • The platform is a true dead end with no incremental path (e.g. a proprietary 4GL), which is rarely the case for .NET Framework, since paths to .NET 10 exist.
  • The organisation can run both and accept delayed value.

Even then, rewrite slice by slice behind a router if possible: a rewrite and a strangler fig are not exclusive.

6. Presenting to executives

One page: the options, a range for cost and time, value timeline, top risks with mitigation, reversibility, and the recommended decision with gates ("we review at month 3 against these measures"). Avoid technical vocabulary; translate code health into incident counts, lead time and staff turnover.

Try it yourself

  1. Score five modules of a system you know on value, change rate, health and understanding.
  2. Use git history (git log --since=1.year --name-only) to find the files that change most, and compare with defect counts.
  3. Estimate a rewrite of one module as P50/P90 and list the implicit rules you'd need to rediscover.
  4. Write a one-page executive summary with three options and a recommendation.
  5. Draft an ADR recording the decision and the assumptions that would make you revisit it.

💻 Code

Mining change frequency and hotspots from git to support the module assessment:

# Files changed most often in the last year (change rate)
git log --since="1 year ago" --name-only --pretty=format: -- '*.cs' \
  | grep -v '^$' | sort | uniq -c | sort -rn | head -20

# Commits mentioning fixes per top-level folder (rough defect density)
git log --since="1 year ago" -i --grep='fix\|bug' --name-only --pretty=format: \
  | grep -v '^$' | cut -d/ -f1-2 | sort | uniq -c | sort -rn

A small model that makes the assumptions behind each option explicit, so executives can challenge numbers rather than opinions:

namespace Contoso.Modernisation;

public sealed record OptionEstimate(
    string Name,
    decimal BuildCostP50,
    decimal BuildCostP90,
    int MonthsToFirstValue,
    int MonthsToComplete,
    decimal MonthlyDualRunningCost,
    decimal MonthlyValueWhenDelivered,
    bool HasStopPoints);

public static class OptionComparison
{
    // Net value over a horizon using the pessimistic (P90) cost: rewrites are rarely early
    public static decimal NetValue(OptionEstimate o, int horizonMonths)
    {
        var monthsDelivering = Math.Max(0, horizonMonths - o.MonthsToFirstValue);
        // Incremental options deliver part of the value early; assume a linear ramp to completion
        var averageValueShare = o.HasStopPoints ? 0.6m : 1.0m;
        var deliveredValue = monthsDelivering * o.MonthlyValueWhenDelivered * averageValueShare;
        var dualRunning = Math.Min(o.MonthsToComplete, horizonMonths) * o.MonthlyDualRunningCost;
        return deliveredValue - o.BuildCostP90 - dualRunning;
    }
}
// Example: the numbers are placeholders to be replaced with your assessment
var rewrite = new OptionEstimate("Rewrite", 2_400_000m, 4_000_000m, 20, 20, 60_000m, 250_000m, HasStopPoints: false);
var incremental = new OptionEstimate("Incremental", 1_800_000m, 2_600_000m, 2, 18, 40_000m, 250_000m, HasStopPoints: true);

foreach (var o in new[] { rewrite, incremental })
    Console.WriteLine($"{o.Name}: net value over 36 months = {Contoso.Modernisation.OptionComparison.NetValue(o, 36):C0}");

⚠ Common mistakes

  • Mistake: Framing it as rewrite versus refactor only. Why it is wrong: it hides cheaper options like retain, retire or replace with SaaS. Instead: compare a portfolio of options per module.
  • Mistake: Deciding for the whole system at once. Why it is wrong: modules differ in value, change rate and health. Instead: assess and decide module by module.
  • Mistake: Estimating a rewrite from the visible features. Why it is wrong: implicit rules, edge cases and integrations are where the time goes. Instead: inventory screens, reports, jobs and integrations, and use reference-class data.
  • Mistake: Single-point estimates. Why it is wrong: they hide uncertainty and set up a failure. Instead: give P50/P90 ranges with stated assumptions.
  • Mistake: Arguing for a rewrite on code quality alone. Why it is wrong: executives can't weigh 'the code is horrible' against risk; the argument gets dismissed or, worse, accepted without a business case. Instead: translate developer experience into business terms: lead time for changes, incidents and their cost, onboarding time for new developers, and attrition of the people who know the system.
  • Mistake: Measuring value by gut feel. Why it is wrong: modules get prioritised by who shouts loudest. Instead: use revenue or cost supported, number of users, regulatory exposure and incident cost per module, even as rough bands.
  • Mistake: Ignoring cost of delay. Why it is wrong: a frozen roadmap for 18 months can cost more than the migration. Instead: include it explicitly in the comparison.
  • Mistake: No decision gates. Why it is wrong: a failing programme continues on sunk-cost grounds. Instead: set review points with measures that trigger continue, change or stop.

🏛 Senior insight: trade-offs

At staff level, the job is to make the decision legible and reversible. I bring options, ranges and assumptions, not a favourite. Most of the time the answer is a mix: retire what nobody uses, replace commodity parts with SaaS, keep stable parts on a supported runtime, and modernise the high-value, high-change core incrementally. Rewrites are the right call more often for small components than for whole systems, and even then I'd rather rewrite slice by slice behind a router.

The industry record supports the caution: Netscape's decision to rewrite its browser from scratch (the case Joel Spolsky made famous) left it without a competitive release for about three years, and many public-sector 'replace the core system' programmes have run years late and well over budget for the same reasons: implicit requirements and a moving target. For estimates, I use the organisation's own history (how long did the last three similar projects take versus their estimates?), size parity work by counting screens, reports, integrations and rules, and re-forecast after each slice, which is far more accurate than story points estimated up front for a multi-year rewrite.

I also check the organisation: a rewrite needs a team that understands the domain deeply and a business willing to wait for value. If either is missing, the technical merits don't matter.

Signal Points to Why
High value, high change, poor health Incremental modernisation Pays back fastest, needs safety
High value, low change, OK health Retain / extract later Low return on migration
Commodity capability Replace with SaaS Not a differentiator
Small, well understood, dead-end design Rewrite (slice by slice) Contained risk
Low value, few users Retire Cheapest option

🔗 Follow-ups the interviewer may ask

  1. When: Candidate mentions designing the new system so it can evolve Why: Checks evolutionary architecture thinking after the decision
    How to answer

    Evolutionary architecture (Ford, Parsons and Kua) is architecture designed to support guided, incremental change, rather than a fixed upfront design. The key tool is fitness functions: automated checks that protect the characteristics you care about, such as dependency rules (architecture tests), latency budgets, or startup time, run in CI or production. Around that, I keep boundaries modular (often a modular monolith first), make decisions reversible where possible and defer irreversible ones to the last responsible moment, record decisions in ADRs, and rely on continuous delivery, feature flags and observability so each change is small and safe.

  2. When: Candidate chooses incremental modernisation Why: Checks how they run large refactoring without stopping delivery
    How to answer

    I treat a large refactoring as a series of small, behaviour-preserving steps merged to main continuously, not a big-bang branch. First I pin current behaviour with characterisation tests. Then I pick a technique: strangler fig to route traffic piece by piece to a new implementation, branch by abstraction to put an interface in front of the old code and swap implementations behind it, or parallel change (expand, migrate, contract) for APIs and database schemas. Feature flags and shadow comparisons let old and new paths run side by side. I prioritise hotspots (code that changes often and hurts), keep refactoring commits separate from feature commits, and define an end state so it does not drag on forever.

  3. When: Candidate talks about convincing the business to fund the work Why: Checks how they prioritise technical debt and get time to pay it down
    How to answer

    Technical debt is the future cost of a shortcut, and the interest is the extra effort or risk it adds every time we work near it. I make it visible in a debt register with each item's impact, how often we pay its interest (change frequency, incidents, delays) and a rough cost to fix. I prioritise by interest, not by how ugly the code is: debt in a hotspot that slows every feature beats a messy module nobody touches. I get time by explaining it in business terms (lead time, incident risk, cost), by reserving a steady share of capacity, and by pairing debt fixes with features that touch the same area.

🛠 Real-world problems: how you handle them

An 18-month rewrite proposal turns into a targeted modernisation
Situation
A [logistics] company's core .NET Framework 4.7.2 system, [about 1.2 million lines], [40 developers]. The engineering team proposed an 18-month rewrite; the board asked for a recommendation within [six weeks].
Signals
Lead time for changes of [six weeks], [two] P1 incidents a month tied to the pricing area, rising attrition among developers, and a data-centre contract ending in [two years].
Investigation
Assessed modules using git change frequency, defect data, Application Insights usage and interviews: [30%] of code was unused, reporting was replaceable with Power BI, billing was stable, and only pricing was both high-change and unhealthy. Built P50/P90 estimates for rewrite, incremental and mixed options using past project data.
Resolution
Recommended a mixed plan: retire unused modules, replace reporting, rehost billing on Azure on 4.8.1, and modernise pricing incrementally to .NET 10 behind YARP, with quarterly gates. The board approved it at about [40%] of the rewrite's P50 cost.
Prevention
ADR recording the decision and the assumptions that would trigger a review; quarterly gate reviews with lead time, incident and cost measures; a dead-code report each quarter.

How to tell it (STAR)

**S:** Our [logistics platform] was slow to change and the team wanted an 18-month rewrite; the board wanted a recommendation in [six weeks]. **T:** I was asked to lead the assessment and present the options. **A:** I assessed it module by module with git history, defect data and usage telemetry, and found most of the pain in one module and a third of the code unused. I put three options to the board with P50/P90 ranges, cost of delay and decision gates, and recommended a mix: retire, replace, rehost and modernise pricing incrementally. **R:** The board approved it at about [40%] of the rewrite cost; the first modernised pricing slice shipped in [seven weeks], and lead time on pricing changes fell from [six weeks] to [one] within the year.

More in Migration Topics

Last updated 23 Nov 2026.

🌐 Sangam's Webring

⏪ Previous 🏠 Main Next ⏩
💬 Chat with me