wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Quiz3-SoftDsn-MakScie

Total questions: 40

Worksheet time: 40mins

Name
Class
Date
1.

Which design pattern ensures that only one instance of a class exists?

a)

Factory Method

b)

Singleton

c)

Builder

d)

Prototype

2.

The Factory Method pattern is primarily used to:

a)

Ensure one instance of a class

b)

Create objects without specifying their concrete classes

c)

Clone existing objects

d)

Build complex objects step by step

3.

Which is not a Creational Design Pattern?

a)

Abstract Factory

b)

Prototype

c)

Facade

d)

Builder

4.

The Abstract Factory pattern is used to:

a)

Create families of related objects

b)

Add responsibilities dynamically

c)

Simplify complex interfaces

d)

Create only one object

5.

Which pattern involves cloning an existing object instead of creating a new one?

a)

Builder

b)

Prototype

c)

Singleton

d)

Decorator

6.

The Facade pattern:

a)

Provides a simplified interface to a complex subsystem

b)

Creates objects dynamically

c)

Allows incompatible classes to work together

d)

Hides object creation logic

7.

The Adapter pattern is used to:

a)

Convert one interface into another

b)

Hide complex subsystems

c)

Clone existing objects

d)

Separate abstraction and implementation

8.

Which pattern provides a way to add new behavior to objects dynamically?

a)

Bridge

b)

Decorator

c)

Composite

9.

The Composite pattern helps to:

a)

A. Treat individual and composite objects uniformly

b)

B. Create a single instance of a class

c)

C. Clone existing objects

d)

D. Control access to another object

10.

The Bridge pattern is used to:

a)

Separate abstraction from implementation

b)

Convert interfaces

c)

Simplify subsystems

d)

Clone existing objects

11.

The Proxy pattern:

a)

Provides a placeholder for another object

b)

Adds new behavior at runtime

c)

Builds complex objects

d)

Converts incompatible interfaces

12.

The Flyweight pattern is used to:

a)

Reduce memory usage by sharing objects

b)

Build objects step by step

c)

Control access to an object

d)

Add new behaviors dynamically

13.

14. The pattern that involves centralizing communication between multiple objects is:

a)

Mediator Pattern

b)

Observer Pattern

c)

Singleton Pattern

d)

Decorator Pattern

14.

Which design pattern is described?

a)

Observer

b)

Mediator

c)

Chain of Responsibility

d)

Strategy

15.

The Observer pattern allows:

a)

Multiple objects to be notified of a state change

b)

One object to control access to another

c)

Sequential access of objects

d)

Object cloning

16.

The Command pattern encapsulates:

a)

A request as an object

b)

An interface into another

c)

A tree structure

d)

A complex subsystem

17.

The Strategy pattern allows:

a)

Dynamic selection of an algorithm at runtime

b)

Object cloning

c)

Simplified subsystem access

d)

Tree-like composition of objects

18.

The State pattern allows:

a)

Changing object behavior based on internal state

b)

Adding behavior dynamically

c)

Creating families of related objects

d)

Traversing data sequentially

19.

The Iterator pattern:

a)

Provides sequential access to elements

b)

Creates a single instance

c)

Adds new behavior dynamically

d)

Separates abstraction from implementation

20.

The Chain of Responsibility pattern:

a)

Passes a request along a chain of handlers

b)

Notifies multiple objects about a state change

c)

Creates related families of objects

d)

Provides simplified subsystem access

21.

The Visitor pattern is used to:

a)

Define new operations without changing existing classes

b)

Simplify complex interfaces

c)

Share objects to save memory

d)

Separate construction from representation

22.

The Template Method pattern:

a)

Defines the skeleton of an algorithm in a base class

b)

Allows dynamic behavior changes

c)

Clones existing objects

d)

Converts one interface to another

23.

The Memento pattern:

a)

Saves and restores object states

b)

Adds new operations

c)

Allows communication between objects

24.

The Interpreter pattern:

a)

Defines a grammar for a language

b)

Adds new behaviors dynamically

c)

Clones objects

d)

Simplifies subsystem interfaces

25.

Which pattern provides a way to undo operations?

a)

Command

b)

Memento

c)

Observer

d)

Strategy

26.

Which pattern is best when multiple classes share similar behavior, but logic must vary independently?

a)

Bridge

b)

Strategy

c)

Template Method

d)

Builder

27.

The Abstract Factory pattern is often implemented using:

a)

Composition

b)

Inheritance

c)

Both A and B

d)

None of the above

28.

The Flyweight pattern minimizes memory usage by:

a)

Reusing shared intrinsic data

b)

Cloning existing objects

c)

Separating abstraction and implementation

d)

Creating objects dynamically

29.

Which pattern promotes loose coupling between sender and receiver objects?

a)

Observer

b)

Mediator

c)

Command

d)

Chain of Responsibility

30.

The Decorator and Proxy patterns are similar because they both:

a)

Implement the same interface as the real object

b)

Clone objects

c)

Create families of objects

d)

Define grammar rules

31.

Which pattern is most useful for GUI components like menus and toolbars?

a)

Composite

b)

Singleton

c)

Mediator

32.

The Bridge pattern differs from the Adapter pattern because Bridge:

a)

Is designed before the system is implemented

b)

Converts incompatible interfaces

c)

Simplifies existing subsystems

d)

Creates only one instance

33.

The Factory Method pattern delegates object creation to:

a)

Subclasses

b)

Parent classes

c)

Client code

d)

Interfaces

34.

The Singleton pattern may cause problems when:

a)

Multiple threads access it simultaneously

b)

It is used with Factory

c)

The object is immutable

d)

It uses static methods

35.

The Visitor pattern violates which principle if overused?

a)

Open/Closed Principle

b)

Single Responsibility Principle

c)

Interface Segregation Principle

d)

Dependency Inversion Principle

36.

The Observer pattern is heavily used in:

a)

Event handling systems

b)

Database normalization

c)

Sorting algorithms

d)

Memory management

37.

The State and Strategy patterns are similar because both:

a)

Encapsulate behavior in separate classes

b)

Clone existing objects

c)

Simplify interfaces

d)

Control access to objects

38.

Which pattern provides centralized control to coordinate other objects’ interactions?

a)

Mediator

b)

Facade

c)

Adapter

d)

Decorator

39.

The Prototype pattern is most useful when:

a)

Object creation is expensive and similar objects are needed

b)

Object creation is simple

c)

Data is immutable

d)

The system is event-driven

40.

Which of the following best describes a “Wireframe” in Visily?

a)

A low-fidelity outline showing basic layout and function

b)

The final polished UI

c)

A 3D animation of a website

d)

A compiled website code