IT 414 Object Oriented Design
Comprehensive Final Exam (Qns & Ans)
2025
Question 1 (Multiple Choice)
Question:
Which design principle states that a class should have only one
reason to change?
A) Open/Closed Principle
B) Single Responsibility Principle
C) Liskov Substitution Principle
D) Dependency Inversion Principle
Correct ANS:
B) Single Responsibility Principle
©2025
, Rationale:
The Single Responsibility Principle (SRP) is a core concept in
object-oriented design that dictates a class should have only one
responsibility. This minimizes coupling and eases maintenance by
ensuring that changes in one part of the system affect only a
single class.
---
Question 2 (Fill in the Blank)
Question:
The process of injecting dependencies into an object rather than
having the object construct them internally is known as
________ .
Correct ANS:
dependency injection
Rationale:
Dependency injection (DI) decouples the creation of an object’s
dependencies from its behavior, promoting modularity and
testability. DI is a key pattern for achieving loosely coupled
architectures.
©2025
,---
Question 3 (True/False)
Question:
True/False: The Liskov Substitution Principle requires that
objects of a subclass should never extend the functionality of their
superclass.
Correct ANS:
False
Rationale:
The Liskov Substitution Principle (LSP) requires that objects of a
subclass can replace objects of the superclass without altering the
desirable properties of the program. It does not prevent a subclass
from extending functionality as long as the extension does not
violate the expected behavior defined by the superclass.
---
Question 4 (Multiple Response)
Question:
©2025
, Select all patterns that belong to the creational category in object-
oriented design:
A) Singleton
B) Factory Method
C) Observer
D) Builder
E) Prototype
Correct ANS:
A) Singleton, B) Factory Method, D) Builder, E) Prototype
Rationale:
Creational design patterns (Singleton, Factory Method, Builder,
and Prototype) are concerned with object creation mechanisms
that increase flexibility and reuse. Observer is a behavioral pattern
used for communication between objects.
---
Question 5 (Multiple Choice)
Question:
©2025
Comprehensive Final Exam (Qns & Ans)
2025
Question 1 (Multiple Choice)
Question:
Which design principle states that a class should have only one
reason to change?
A) Open/Closed Principle
B) Single Responsibility Principle
C) Liskov Substitution Principle
D) Dependency Inversion Principle
Correct ANS:
B) Single Responsibility Principle
©2025
, Rationale:
The Single Responsibility Principle (SRP) is a core concept in
object-oriented design that dictates a class should have only one
responsibility. This minimizes coupling and eases maintenance by
ensuring that changes in one part of the system affect only a
single class.
---
Question 2 (Fill in the Blank)
Question:
The process of injecting dependencies into an object rather than
having the object construct them internally is known as
________ .
Correct ANS:
dependency injection
Rationale:
Dependency injection (DI) decouples the creation of an object’s
dependencies from its behavior, promoting modularity and
testability. DI is a key pattern for achieving loosely coupled
architectures.
©2025
,---
Question 3 (True/False)
Question:
True/False: The Liskov Substitution Principle requires that
objects of a subclass should never extend the functionality of their
superclass.
Correct ANS:
False
Rationale:
The Liskov Substitution Principle (LSP) requires that objects of a
subclass can replace objects of the superclass without altering the
desirable properties of the program. It does not prevent a subclass
from extending functionality as long as the extension does not
violate the expected behavior defined by the superclass.
---
Question 4 (Multiple Response)
Question:
©2025
, Select all patterns that belong to the creational category in object-
oriented design:
A) Singleton
B) Factory Method
C) Observer
D) Builder
E) Prototype
Correct ANS:
A) Singleton, B) Factory Method, D) Builder, E) Prototype
Rationale:
Creational design patterns (Singleton, Factory Method, Builder,
and Prototype) are concerned with object creation mechanisms
that increase flexibility and reuse. Observer is a behavioral pattern
used for communication between objects.
---
Question 5 (Multiple Choice)
Question:
©2025