What are the most useful design patterns to know for LLD interviews?
Fast recall
Quick revision
Core answer
Pattern recognition—can you identify when a standard pattern solves a recurring design problem rather than inventing solutions from scratch.
Forcing patterns into the design where they don't fit, or not recognizing obvious pattern opportunities like using Singleton for a globally shared resource.
Mention the problem each pattern solves before applying it, showing you understand the 'why' not just the 'how'—e.g., 'I'd use Strategy here because pricing rules change frequently.'
Interview-ready guide
Interview answer
There are twenty-three classic Gang-of-Four patterns, but for fresher LLD interviews I focus on five that come up again and again. Singleton ensures exactly one shared instance of something, like a ParkingLot controller, using a private constructor and a getInstance method. Strategy lets me swap interchangeable algorithms behind an interface — that's the one I use for pricing or search, where the rules change but the surrounding code shouldn't. Observer is for event notification: when a spot is freed, the display boards that registered as observers get notified automatically, which keeps the spot decoupled from the display. Factory hides the choice of concrete class behind a create method, so I don't scatter new-statements and type checks around. And Builder gives a readable, fluent way to construct objects that have lots of optional fields, like a parking ticket.
For each one, I make sure I can state the problem it solves, sketch a one-line Java version, and — this is the part that impresses — say when not to use it. Strategy and Observer are the two I reach for most. But I'd be candid that patterns are tools, not goals. Forcing a Factory onto a trivial two-class hierarchy just adds indirection, Singletons are really global state and overusing them hurts testability, and a Builder for a two-field object is overkill when a constructor or a record reads better. So I name a pattern only when I can name the concrete problem it removes from my design.
What are the most useful design patterns to know for LLD interviews
Direct Answer
The most useful design patterns for LLD interviews are: Singleton for ensuring one shared instance (like ParkingLotManager), Strategy for interchangeable algorithms (different pricing strategies), Observer for event notification (notify users when spots are available), Factory for creating objects without specifying exact class (VehicleFactory creates Car or Motorcycle), Builder for constructing complex objects step-by-step (ParkingLotBuilder), and Decorator for adding features dynamically (adding VIP features to a ParkingSpot).
Deep Dive & Architecture
Design pressure and matching pattern
Strategy fits interchangeable rules such as parking fees or discount calculation. Observer fits one event with several independent listeners, such as a freed spot updating display boards. Factory fits object creation that depends on input or setup rules. Builder helps construct an object with many optional values or a staged validation process.
State and Command solve behavioural problems
State is useful when allowed operations change with a lifecycle, such as an ATM session or order. Command represents an action as an object when it needs queuing, retries, auditing, or undo. These patterns add more classes, so the requirement should justify that cost.
Treat Singleton with caution
One real-world resource does not automatically require a global Java object. Dependency injection can create one application-scoped instance without hiding dependencies, and a database or distributed lock—not Singleton—protects shared state across application instances. A useful interview answer explains one concrete pressure, shows how the pattern changes the classes, and names when the simpler direct design would be better.
Code Example
class VehicleFactory { // Factory: hide concrete class choice
static Vehicle create(VehicleType t, String plate) {
return switch (t) {
case CAR -> new Car(plate);
case TRUCK -> new Truck(plate);
case MOTORCYCLE -> new Motorcycle(plate);
};
}
}
// Builder: readable construction with optionals
ParkingTicket t = new ParkingTicket.Builder()
.vehicle(car).spot(spot).entry(LocalDateTime.now())
.build();
Common Mistakes & Pitfalls
- Pattern obsession — forcing a Factory on a two-class hierarchy. Patterns are tools, not goals.
- Singleton everywhere — it's global state; overuse hurts testability.
- Naming a pattern without its problem — say why it's needed.
- Builder for two fields — a constructor or
recordis clearer; Builder shines with many optionals.
Check your understanding
Answer these without looking back at the article.
- What is Low-Level Design (LLD) and why does it exist? It translates high-level architecture into concrete class structures, relationships, and APIs that a developer can directly implement, bridging the gap between architecture and code.
- What is Low-Level Design (LLD) and what does an LLD interview expect you to do?
- What is the step-by-step process for solving an LLD interview question?
Looking for a structured roadmap?
Every module on this page is also part of the full Java backend interview track.