What is the Strangler Fig pattern and its use in legacy modernization?

Tests incremental modernization over big-bang rewrites. A strong answer covers the botanical metaphor, building new components alongside legacy, routing traffic, extracting seams, and four activities. Red flag: a long rewrite delivering no value until launch.
What's really being asked
This question tests whether you understand incremental modernization as a strategic alternative to high-risk rewrites. Interviewers want to see that you grasp the organizational and technical mechanics of gradually replacing a legacy system while continuing to deliver business value. It also checks if you know the specific terminology and can connect it to agile principles like early feedback, iterative delivery, and risk reduction.
The full answer
First, the botanical metaphor itself: a vine that germinates in a host tree, grows roots and canopy, becomes self-sustaining, and eventually replaces the host. Second, the technical approach of building new functionality alongside the legacy system rather than inside it, often using an anti-corruption layer or facade to route requests incrementally from old to new components. Third, the concept of finding seams in the legacy codebase to isolate replaceable parts, since legacy systems rarely have clear component boundaries. Fourth, the four activities defined by Ian Cartwright, Rob Horn, and James Lewis: understand the outcomes you want, break the problem into smaller parts, deliver those parts successfully, and change the organization to sustain this practice. Fifth, the necessity of transitional architecture to bridge old and new during the migration.
The mistakes people make
A red flag is proposing a big-bang rewrite where users wait months or years for new features. Another is suggesting you must fully understand every detail of legacy behavior before starting; in reality much legacy behavior is unwanted and discovering this is part of the process. Saying the pattern is only about microservices is also wrong; while it pairs well with service extraction, the core idea is incremental replacement regardless of target topology. Finally, ignoring organizational change and treating modernization as purely a technical exercise signals immaturity.
What usually comes next
Interviewers may ask how you would identify seams in a monolith with no clear boundaries. They might probe how to handle data migration when strangling a system with a shared database. Another common follow-up is how to manage the business case when running two systems in parallel, or how to decide which components to strangle first.
A concrete example
Suppose a retail company has a twenty-year-old mainframe order system. Instead of rewriting it entirely, the team builds a new pricing service that sits behind an API gateway. The gateway routes pricing requests to the new service while order fulfillment stays on the mainframe. Over six months, the team extracts inventory, then customer lookup, each time redirecting traffic through the gateway. Eventually the mainframe handles only a small reporting module, which is then replaced. The business receives better pricing and inventory capabilities within weeks rather than waiting two years.
Interview question
When modernizing a legacy mainframe using the Strangler Fig pattern, which strategy best aligns with the pattern's core approach?
- a.Restructure the legacy monolith into microservices first to create clear boundaries before any replacement begins
- b.Defer new business capabilities until the new system achieves full functional parity with the legacy platform
- c.Build new components alongside the legacy system and incrementally route traffic to them via a facade or gatewayCorrect
- d.Audit all legacy behaviors for several months, then cut over to a complete replacement in a single release
Why? this is the answer
The Strangler Fig pattern delivers business value early by building new components alongside legacy and incrementally routing traffic, avoiding risky big-bang rewrites. Option D is tempting because thorough upfront analysis feels safer, but the pattern explicitly avoids waiting for complete understanding before starting delivery.
Just read this? Test yourself on what you have been reading.
Read the original → martinfowler.com
- #legacy modernization
- #agile architecture
- #strangler fig
- #refactoring
- #system design
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles