Test your Design-patterns knowledge with a free interactive quiz — 50 questions with answers and explanations. No signup needed to play.
Question 1/12Score 0
```
public class Config {
private static Config instance;
private Config() {}
public static Config getInstance() {
if (instance == null) instance = new Config();
return instance;
}
}
``` Which pattern is this?
In this round
```
public class Config {
private static Config instance;
private Config() {}
public static Config getInstance() {
if (instance == null) instance = new Config();
return instance;
}
}
``` Which pattern is this?
Why use design patterns at all?
```
User u = new User.Builder()
.name("Lena")
.email("lena@example.com")
.age(25)
.build();
``` Which pattern is this?
```
interface Compressor { byte[] compress(byte[] data); }
class GzipCompressor implements Compressor { ... }
class ZstdCompressor implements Compressor { ... }
class Backup {
Backup(Compressor c) { this.c = c; }
void run(byte[] data) { storage.write(c.compress(data)); }
}
``` Which pattern is this?
Which best describes the **Observer** pattern?
Which best describes the **Composite** pattern?
What does "GoF" refer to in the design-pattern world?
Which best describes the **Singleton** pattern?
What is a "design pattern" in software engineering?
Which best describes the **Iterator** pattern?
Which best describes the **Factory Method** pattern?
Which three categories does the GoF catalog organize patterns into?