Design Patterns Flashcards

1
Q

What is the difference between the Factory Pattern and the Abstract Factory Pattern?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain the Singleton Pattern. What are its pitfalls in a multi-threaded environment, and how do you make it thread-safe?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Can you walk me through how the Strategy Pattern works?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How Strategy Pattern compares to the State Pattern?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How would you implement the Observer Pattern, and where have you seen it used in real-world applications?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the Decorator Pattern?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Adapter Pattern?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is Proxy Pattern?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the differences between Adapter, Decorator and Proxy?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the advantages of using the Builder Pattern over telescoping constructors or setters?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Can you describe a scenario where using the Command Pattern is appropriate? How does it support undo/redo functionality?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the difference between Composition and Inheritance in the context of design patterns? Which do design patterns prefer and why?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly