Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Design Patterns Quiz

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What is a design pattern in the context of software engineering?

a)

A set of coding conventions

b)

A reusable solution to a common problem in software design

c)

A specific programming language syntax

d)

A detailed project plan

2.

Which of the following is a creational design pattern?

a)

Singleton

b)

Observer

c)

Adapter

d)

Composite

3.

Which pattern ensures a class has only one instance and provides a global point of access to it?

a)

Prototype

b)

Singleton

c)

Adapter

d)

Facade

4.

Which design pattern is used to represent the dependency between objects to notify other objects when there is a state change?

a)

Observer

b)

Factory Method

c)

Decorator

d)

Command

5.

In which design pattern do objects take on multiple responsibilities instead of specializing in one?

a)

Strategy

b)

Adapter

c)

Composite

d)

Facade

6.

Which design pattern provides an interface for creating families of related or dependent objects without specifying their concrete classes?

a)

Abstract Factory

b)

Builder

c)

Singleton

d)

Chain of Responsibility

7.

Which structural design pattern allows objects with incompatible interfaces to work together?

a)

Adapter

b)

Decorator

c)

Proxy

d)

Composite

8.

Which behavioral design pattern allows an object to alter its behavior when its internal state changes?

a)

Strategy

b)

State

c)

Observer

d)

Command

9.

Which pattern is often used to provide a simplified interface to a complex subsystem?

a)

Adapter

b)

Facade

c)

Singleton

d)

Composite

10.

Which design pattern encapsulates a request as an object, thereby allowing users to parameterize clients with queues, requests, and operations?

a)

Command

b)

Iterator

c)

Observer

d)

Memento

11.

Which design pattern is used when you want to create a family of related objects that are intended to be used together?

a)

Singleton

b)

Abstract Factory

c)

Builder

d)

Prototype

12.

Which design pattern allows an object to change its behavior when its state changes, often by having a state class for each possible state?

a)

Command

b)

Observer

c)

State

d)

Iterator

13.

Which creational design pattern allows you to create different representations of a complex object?

a)

Singleton

b)

Builder

c)

Prototype

d)

Factory Method

14.

Which structural design pattern composes objects into tree structures to represent part-whole hierarchies?

a)

Composite

b)

Adapter

c)

Decorator

d)

Proxy

15.

Which design pattern involves the creation of an object that holds the state of another object and allows restoring it later?

a)

Command

b)

Memento

c)

Observer

d)

Prototype