OOD & LLD Reference/Design Patterns (Interview Core)

Pattern Selection & Anti-Patterns

How to choose patterns under interview time pressure, common over-engineering mistakes, and the difference between 'uses a pattern' and 'force-fits a pattern'.

3/5Overview: 20m

Choosing patterns under interview pressure

Patterns are tools, not goals. The right process: (1) identify the axis of variation, (2) check if a simple interface suffices, (3) name the pattern only if it clarifies communication.

SmellLikely patternSimpler alternative
switch on type growingStrategy or FactoryMap of handlers if < 5 variants
Behavior stacks (logging + cache + auth)DecoratorMiddleware chain / interceptors
Complex object with 10+ fieldsBuilderConstructor with required fields only
Object changes mode frequentlyStateEnum + methods if ≤ 4 states
Notify many listeners on changeObserverCallback list on one interface

Common anti-patterns in LLD interviews

Pattern stackingAbstractSingletonFactoryProxy before requirements are clear. Premature abstraction — interface per class when there's one implementation. Anemic domain model — entities are data bags, all logic in services (acceptable briefly, but note the trade-off). God class — one SystemManager owns everything. Copy-paste polymorphism — three classes with identical methods differing only in one line (extract Strategy).

The YAGNI handshake

Senior signal = naming what you'd defer: "I'll use a concrete TokenBucketLimiter today; if we add sliding window, I'll extract RateLimitAlgorithm then." Interviewers prefer honest scoping over speculative frameworks.

Interview recovery move

If you've over-patterned, pause: "Let me simplify — we only need one implementation today, so I'll collapse these three interfaces into a single PaymentService and extract when the second provider appears." Recovering gracefully scores well.

Senior-level signal

Practice the phrase: "I'd start with the simplest design that meets stated requirements, then isolate the first extension point behind an interface." If challenged, compare two designs in one sentence: "Strategy adds one interface and N classes; a switch is fine for two cases but breaks OCP at three."

Where this goes next

Running an LLD Round applies these principles to the full 45-minute interview flow — where patterns fit in the timeline and when to stop designing.

Further Reading

Practice Tasks (Optional)

Design or implement locally in any language — no autograding. Focus on class structure, extensibility, and being able to explain trade-offs out loud.

  • Simplify an over-patterned design

    Given: 'AbstractFactory creates AbstractSingletonProxyFactoryBean'. Propose the simplest design that still supports two product families. Practice saying 'I'd start simpler and add patterns only when requirements demand' out loud.

    15m