wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

sOME HISTORY STUFF

Total questions: 53

Worksheet time: 29mins

Name
Class
Date
1.

Which of the following statement is true. You may select more than one option

a)

Design patterns are considered best practices and are often used by proficient

object-oriented software developers.

b)

Design patterns have evolved over time through a collective iterative process by

many software developers

c)

Design patterns are typical solutions to common challenges in software design.

d)

Design patterns are static rules that do not evolve over time

2.

What is the primary purpose of structural design pattern?

a)

They break down existing classes into smaller and simpler structures.

b)

They primarily handle object creation mechanisms.

c)

They are used to create complex class structures by combining simpler classes.

d)

They focus on communication between disjoint systems.

3.

Which of the following statements accurately describes the iterator design pattern?

a)

It is primarily used for modifying elements of a collection.

b)

It restricts access to the elements of a collection.

c)

It allows you to traverse elements of a collection while exposing its underlying

representation.

d)

It lets you traverse elements of a collection without exposing its underlying

representation.

4.

What is the purpose of the Adapter design pattern?

a)

It is a pattern that deals with communication between objects

b)

It is a pattern that allows objects with incompatible interfaces to collaborate

c)

It is a pattern that deals with object creation mechanism

d)

It is a pattern that provides a way to control access to another object

5.

If you are working with objects that have very different internal representations,

such as enumeration types, event handling, or statefulness, which design pattern

would you apply?

a)

Structural design pattern

b)

Creational design pattern

c)

Behavioral design pattern

d)

Singleton design pattern

6.

What is true about Software Architecture and Detailed Design?

a)

both can be easily translated into code

b)

software architecture highlights the major components of the system

c)

detailed design helps to easily translate design into code

d)

detailed design is the external structure of the components

7.

What are the tasks in detailed design (Otero, 2012)?

a)

Interface design, User interface design, Internal component design, Data design

b)

Interface design, User interface design, external component design, Data design

c)

User interface design, internal component design, Data design

d)

User interface design, external component design, Data design

8.

What is the O in SOLID?

a)

Open-Closed : classes should be closed for modification and extension

b)

Open-Closed : classes should be closed for modification and open for extension

c)

Open-Closed : classes should be open for modification and extension

d)

Open-Closed : classes should be open for modification and closed for extension

9.

Which SOLID principle is violated in this design?

a)

Single Responsibility

b)

Open Closed

c)

Liskov Substitution

d)

Interface Segregation

e)

Dependency Inversion

10.

You launched your application to the client and all is working well. Now the client

start using different database: MySQL instead of Postgres and you know that your client in the

future might want to be able to switch databases.

Modifying OrderRepository directly would violate which principle?

a)

Single Responsibility

b)

Open Closed

c)

Liskov Substitution

d)

Interface Segregation

e)

Dependency Inversion

11.

All circles are inherently ellipses with

their x and y radii being equal.

If Circle inheriting from Ellipse

violates Liskov Substitution, which methods cause this

issue?

a)

setXRadius()

b)

getArea()

c)

setYRadius()

12.

Select all the creational design patterns

a)

Factory, Abstract Factory

b)

Builder

c)

Facade

d)

Prototype, Singleton

e)

Observer

13.

If there are changes in the original code, the copy code will be affected too for shallow cloning

a)

True

b)

False

14.

Which of the following is true about design patterns?

a)

Design patterns are solutions to general problems that

software developers faced during software development

b)

Design patterns represent the best practices used by

experienced object-oriented software developers.

c)

Design patterns are obtained by trial and error by

numerous software developers over quite a substantial

period of time.

15.

Suppose you need to create new objects by copying an

existing object. Which of the following patterns would you

most likely use? Please select the best answer.

a)

Abstract Factory

b)

Builder

c)

Prototype

d)

Singleton

16.

Suppose you need to define an interface for creating instances of several related abstract classes without specifying their concrete subclasses. Which of the following patterns would you most likely use?

Please select the best answer.

a)

Abstract Factory

b)

Builder

c)

Prototype

d)

Factory

17.

The general purpose of the Singleton pattern is to:

Please select the best answer.

a)

Ensure that no more than one instance of a class exists ever

b)

Ensure that only one class exists at the same time.

c)

Separate objects in a single class from objects in another class.

d)

Control creation of objects in a single class or another class.

18.

Which of the following is correct about the Factory design

pattern.

a)

Factory pattern creates object without exposing the

creation logic to the client.

b)

This type of design pattern comes under creational

pattern.

c)

Factory pattern refers to newly created object using a

common interface.

19.

Which one is pattern creating a duplicate object?

a)

Factory Pattern

b)

Prototype Pattern

c)

Builder Pattern

d)

Singleton Pattern

20.

Which pattern is implemented in this code snapshot?

a)

Factory

b)

Abstract Factory

c)

Singleton

d)

Prototype

21.

If you are working with objects that have very different internal representations, such as enumeration types, event handling, or statefulness, which design pattern would you apply?

a)

Structural design pattern

b)

Singleton design pattern

c)

Creational design pattern

d)

Behavioral design pattern

22.

What is the purpose of the Adapter design pattern?

a)

The Adapter design pattern is a pattern that deals

with communication between objects.

b)

The Adapter design pattern is a pattern that

provides a way to control access to another object.

c)

The Adapter design pattern is a pattern that deals

with object creation mechanisms, trying to create

objects in a manner suitable to the situation.

d)

The Adapter design pattern is a structural design

pattern that allows objects with incompatible interfaces to collaborate.

23.

How can the Adapter design pattern be used to solve the problem of incompatible interfaces?

a)

How can the Adapter design pattern be used to solve the problem of incompatible interfaces?

b)

By implementing a class that realizes the target interface by delegating to an instance of the third-party class.

c)

By implementing a class that realizes the target

interface by delegating to an instance of the third-

party class.

d)

By renaming the functions of the third-party class to

match the target interface.

24.

What are behavioral design patterns used for?

a)

Behavioral design patterns are used to create

objects in a system.

b)

Behavioral design patterns are used to structure

objects in a system.

c)

Behavioral design patterns are used to describe

common ways in which objects interact and behave.

d)

Behavioral design patterns are used to define the

architecture of a system.

25.

What does the IIterator interface define in the iterator design pattern?

a)

The operations to delete elements from the

collection.

b)

The operations to sort the elements in the collection.

c)

The operations to add elements to the collection.

d)

The operations to go through the elements in the

collection.

26.

Behavioral design patterns describe common ways in which objects are created.

a)

True

b)

False

27.

The iterator design pattern consists of the ICollection interface, the IIterator interface, and the ConcreteCollection class.

a)

True

b)

False

28.

The iterator design pattern is commonly used in languages like C# and Java, which have explicit syntax for using iterators.

a)

True

b)

False

29.

We are designing a mapping application. Users should be

able to navigate the map by choosing a country, then a state

or province within that country, and so on, for as many levels

of administrative unit exist within the country. Countries

differ in the number of levels they have and the terminology

they use, but the programmers want to be able to interact

with them all through a common interface.

Which design pattern in structural should we use in this case?

a)

Adapter

b)

Decorator

c)

Composite

30.

We are designing a map application. The maps are to be

displayed on a screen and are overlaid with different types of

information, such as population density, topological features,

and land usage. The same map might show any combination

of these (or none of them) depending on choices made by

the user. Which design pattern would you use here?

a)

Composite

b)

Decorator

c)

Adapter

31.

You cannot make changes to any of these classes.

Which design pattern would you use to allow this extension?

a)

Adapter

b)

Composite

c)

Decorator

32.

In which of the following pattern, a class behavior or its

algorithm can be changed at run time?

a)

Observer Pattern

b)

Template Pattern

c)

Strategy Pattern

d)

Iterator Pattern

33.

Which design pattern would you choose if you would like to

traverse a collection of objects without exposing its

implementation.

a)

Iterator

b)

Observer

c)

Strategy

d)

Template

34.

Which design pattern would you choose to allow clients to

treat collections of objects and individual objects uniformly.

a)

Decorator

b)

Iterator

c)

Composite

d)

Observer

35.

Suppose we have a sorter class and would like to be able to

sort in ascending order or descending order.

How would you implement the design pattern?

a)

Strategies

b)

Template

c)

Iterator

d)

Decorator

36.

Which level of detailed design does construction design address?

a)

Checking conditions before taking actions

b)

Generating correct and efficient code

c)

Planning and evaluating complex operations

d)

Modeling and specification of function implementation

37.

What is the purpose of construction design in software development?

a)

It focuses on reducing the physical size of the code to optimize storage space.

b)

It involves designing software interfaces that are user-friendly and visually

appealing.

c)

It is a design approach that emphasizes post-implementation code refactoring.

d)

It provides a form of design that closely resembles code so that complex

operations can be planned and evaluated prior to implementation in code.

38.

What step does construction design follow in the software engineering process?

a)

Software testing

b)

Software architecture and detailed design

c)

Software maintenance

d)

Software requirements

39.

What is the purpose of a join node in an activity diagram?

a)

To represent an if statement in code

b)

To split a single incoming flow into multiple concurrent flows

c)

To synchronize multiple concurrent flows into a single outgoing flow

d)

To bring together multiple incoming alternate flows into a single outgoing flow

40.

What is the purpose of a guard in a UML activity diagram?

a)

A guard is a node that joins multiple concurrent flows

b)

A guard is used to split a single incoming flow into multiple concurrent flows

c)

A guard is a condition which must be true in order for the trigger to cause the

transition

d)

A guard is a control node that brings together multiple incoming alternate flows

41.

What are the two topics that should be learned

before studying construction design?

a)

Software requirements and software design

b)

Flow-based design and state-based design

c)

Software architecture and detailed design

d)

Solid principles and design patterns

42.

If you are given a complex operation to implement

in code, which design approach would you use to

plan and evaluate it prior to implementation?

a)

Construction design

b)

Design patterns

c)

Solid principles

d)

Software architecture

43.

You are given the following activity diagram. Which of the

following action sequences are possible during one execution

of the activity diagram? You may select multiple options.

a)

A ->B

b)

A -> C

c)

A ->B ->C

d)

A ->B ->B

e)

A ->C ->B

44.

You are given the following activity diagram. Which of the

following action sequences are possible during one execution

of the activity diagram?

a)

A->B ->C ->D

b)

A ->B ->C

c)

A ->B ->D ->C

d)

A ->D

45.

You want to model the following situation using a state-diagram. A home delivery

service has the two states wait and deliver. At the beginning, wait is active. As

soon as a customer has ordered a product, a transition to deliver takes place.

During the transition, the order is processed. deliver stays active until the product

has been delivered to the customer, then a transition to wait happens.

How do you specify the transition from wait to deliver?

a)

Event: Order received

b)

Activity: Order received

c)

Event: process order

d)

Activity: order is processed

46.

You are given the following state

machine diagram. Which of the

following statements are true?

a)

After the customer has indicated

enough money into the machine, a

transition to Order takes place.

b)

As soon as change and cigarettes

have been ejected, Idle becomes the

next active state.

c)

If CardCheck is active and the card

is valid, Order immediately becomes

the next active state.

47.

What is one way to measure cohesion in software design?

a)

Looking at the number of subclasses of each class

b)

Looking at the depth of the inheritance hierarchy

c)

Looking at the number of pairs of classes that invoke each other's methods

d)

Looking at the number of methods that do not have any instance variables in

common

48.

Which of the following characteristics should be evaluated for all software projects?

a)

Security, usability, efficiency, simplicity

b)

Completeness, correctness, testability, maintainability

c)

Scalability, performance, reliability, flexibility

d)

Interoperability, maintainability, reusability, portability

49.

If you were to evaluate a software design, which characteristics would you consider

as a minimum requirement?

a)

The design's simplicity, efficiency, and peer review results.

b)

The design's completeness, correctness, testability, and maintainability.

c)

The design's implementation of solid principles and object-oriented metrics.

d)

The design's static complexity metric and architecture trade-off analysis method

results.

50.

What is the goal when designing in terms of cohesion and coupling?

a)

The goal when designing is to achieve low cohesion and low coupling.

b)

The goal when designing is to achieve low cohesion and high coupling.

c)

The goal when designing is to achieve high cohesion and low coupling

d)

The goal when designing is to achieve high cohesion and high coupling.

51.

Select all factors that contribute to the complexity of a class in software design:

Select 3 correct answer(s)

a)

The programming language used to implement the class

b)

The complexity of the individual methods in the class

c)

The number of methods and attributes in the class

d)

The number of methods of other classes invoked by the class

e)

The length of the class name and the number of comments within the class

52.

What are the correct aspects of object oriented metrics? (You can select more than 1 option)

a)

Size

b)

Volume

c)

Quality

d)

Inheritance

e)

Cohesion

53.

What is the first step in the software design process?

a)

Construction design

b)

Detailed design

c)

Architecture design

d)

Evaluation design