Flashcards

Quick study sessions to strengthen memory and retain key concepts.

Flashcard Study

Java: Pattern Abuse

Front

How would you explain a common sign of pattern abuse in an interview?

Introducing abstractions before the code shows real variability. A pattern is probably premature when it exists only for…

View Card →
Flashcard Study

Java: Pattern Abuse

Front

What should usually trigger a pattern choice?

A recurring change point, not a desire for abstraction by itself. Patterns are most useful when they isolate…

View Card →
Flashcard Study

Java: Observer Pattern

Front

When does Observer help checkout design?

When one domain event should trigger multiple independent downstream actions. If `OrderPlaced` should lead to loyalty updates, email…

View Card →
Flashcard Study

Java: Factory Pattern

Front

How might over-engineering manifest with factories?

Creating factories for trivial objects. Frame the concept in practical terms so you can explain it during interview…

View Card →
Flashcard Study

Java: Factory Pattern

Front

How would you explain the design consequence of the Factory Pattern in an interview?

It improves code flexibility and scalability. The Factory Pattern enhances design flexibility by separating object creation from its…

View Card →
Flashcard Study

Java: Factory Pattern

Front

Why use a Factory for creating abstracted interfaces?

To hide concrete class instantiation from the client. Factories return abstracted interfaces, which helps in hiding the concrete…

View Card →
Flashcard Study

Java: Factory Pattern

Front

What architectural smell indicates the need for a factory?

Repeated and complex instantiation logic scattered across the codebase. If you notice that object creation logic is duplicated…

View Card →
Flashcard Study

Java: Factory Pattern

Front

When is the Factory Pattern preferred over direct instantiation?

When object creation involves complex logic or dependencies. The Factory Pattern is preferred when object creation is complex,…

View Card →
Flashcard Study

Java: Factory Pattern

Front

Why does a Factory Method matter in this design?

It defines an interface for creating an object, but lets subclasses alter the type of objects that will…

View Card →
Flashcard Study

Java: Factory Pattern

Front

How can Spring's IoC container serve as an ultimate factory?

It manages object creation and lifecycle. Frame the concept in practical terms so you can explain it during…

View Card →