The Chronicle 3 min read
Object-Oriented Design

Open-Closed Principle in Interviews: Handling a Mid-Design Requirement Change

How to absorb “one more requirement” with minimal blast radius

L
LLDCanvas Team·Engineering
October 10, 2026
3 min read 12 views 0 likes
☰ Jump to section

Twenty minutes into your LLD design, the interviewer smiles: “Also support coupon codes.” Or WhatsApp notifications. Or surge pricing. They are not being cruel — they are testing whether your structure bends or breaks.

That test is the Open-Closed Principle in interview clothing: open for extension, closed for modification. This article shows how to place seams so “one more requirement” stays small.


01What Interviewers Measure with a Twist

  • Did you hard-code the volatile decision?
  • How many boxes turn red when the twist arrives?
  • Can you extend with a new type instead of editing five methods?
  • Do you explain the trade-off of the seam you chose?

02Find Volatility Before You Draw

During clarification, ask what is likely to change. Classic volatilities in LLD prompts:

Domain signalLikely volatilitySeam to consider
Multiple providersPayment / auth / mapsInterface + implementations
Multiple channelsEmail / SMS / pushNotifier strategy
Rules differ by plan/regionPricing / eligibilityPolicy / Strategy
Optional extrasLogging, metrics, retryDecorator

You cannot abstract everything. Abstract the axes the story emphasizes.


03Worked Mini-Example: Pricing Twist

Initial ask: flat fare for rides. Twist: support surge multipliers at peak hours.

text
// Fragile
FareService.calculate(distance) {
  return distance * RATE;
  // later: sprinkle if (peak) everywhere
}

// OCP-friendlier
FareService depends on PricingStrategy
FlatPricing implements PricingStrategy
SurgePricing implements PricingStrategy

The twist adds SurgePricing (and maybe a factory/selector). FareService stays mostly closed.


04Blast Radius Checklist After a Change

  1. List every type you edited.
  2. If the list includes stable domain entities for a peripheral rule, your seam was wrong.
  3. Prefer adding a type over editing a switch.
  4. Re-run the original use case mentally — OCP is not an excuse to break old paths.

Change One Thing on LLDCanvas drops a new requirement mid-design and scores how small your blast radius stays against an OCP-compliant ideal.


05Five Interview Twists and Low-Blast Responses

TwistBad reactionLow blast-radius move
Add a second payment providerEdit CheckoutService if-elseNew PaymentGateway implementation
Add retry once on soft failureCopy retry into every providerDecorator around PaymentGateway
Add student discountSprinkle if (student) in fare mathPricingStrategy / discount policy object
Audit every state changeLog calls in every mutatorDomain event or auditing interceptor at the seam
Support read-only guest modeBoolean flags across servicesAuthorization policy consulted at use-case entry

When you practice, time how long the twist takes. Under five minutes with a clear narration is a strong signal. Fifteen minutes of redrawing usually means the first design hid the volatility inside concrete types.

What to say when you did not leave a seam

Be honest: “I hardcoded email sends inside OrderService, so this change forces an edit there. I would extract a Notifier interface now, migrate the email impl, then add SMS.” Interviewers respect a clean recovery more than a pretend-perfect first draft.


06OCP vs Long-Term Evolution

OCP drills are local: one change, minimal edits. Multi-stage product growth — new markets, debt, scale — needs a longer lens. Continue with evolving software design as requirements grow when you are ready for multi-stage thinking.


07Key Takeaways

  • Requirement twists test OCP and calm under pressure.
  • Identify volatility early; place interfaces there.
  • Measure success by blast radius, not by pattern count.
  • Extend with new types when the variation is behavioral.

Practice absorbing one surgical change at a time in Change One Thing.

Frequently Asked Questions

ABlast radius is how many types you must edit to satisfy a new requirement. Small blast radius usually means better OCP alignment.

L

LLDCanvas Team

Engineering at LLDCanvas

Ready to practice?

Turn reading into results

110+ LLD interview questions, a live canvas, and timed Interview Mode.

Reader’s Notes (0)

Sign in to join the discussion

Sign in

Loading notes…