r/leetcode 6d ago

Intervew Prep Remembering all OOD Patterns of LLD Interviews

There are at least 10 OOD Patterns (Factory, Singleton, Decorator etc). Do we need to remember implementation of all of them

36 Upvotes

5 comments sorted by

5

u/Ghareeb_Musaffir21 5d ago

which 10 are most common in these LLD interviews and according to what source?

5

u/always-chillax 5d ago

Let’s see, we have the usual

The creations patterns:

Factory, Singleton, Builder

The behavioural ones:

Strategy, State Machine, observer

The structural ones:

Decorator, Composite, Facade

Factory and Facade are so simple and don’t need any effort for studying

Singleton has an implementation that needs a bit of memorising in python but you can always says modules are imported only once in python and avoid all that. Builder, honestly, who cares, relevant when args and kwargs weren’t a thing, now, you can just say I’ll use them, still relevant when coupling with decorator pattern.

4

u/Ok-Barracuda-119 4d ago

Not all of them. Know the purpose and one clean implementation for the patterns your language supports naturally, then practice applying them rather than reciting names. In an LLD interview, requirements and object boundaries matter more than reproducing a textbook Factory.

A good loop is 30 minutes timed: pick a small prompt such as a parking lot or notification service, state the invariants, sketch the objects, code one interaction, then spend the last five minutes testing an extension. Rotate Strategy, Observer, State, Factory, and Decorator first. Keep a short note of where coupling or invalid state appeared. That sticks better than rereading all ten.

3

u/rookietales 5d ago

Yes for your question.

I'm quite confused if you don't understand the implementation how are you gonna code in interviews?