Practice Questions and Detailed Solutions Latest Update
2026/2027 | System Design, Class Diagrams, Verified Answers -
190 Questions
This midterm examination covers advanced concepts in object-oriented analysis and design, including system
design, class diagrams, UML modeling, design patterns, architectural styles, and requirement analysis. It
emphasizes practical application, critical evaluation, and synthesis of modern OOAD principles in complex
scenarios. It contains 190 multiple-choice questions, each with four distractors and a fully worked rationale that
explains why the keyed answer is correct. Questions are organized into clearly labelled sections that mirror the
major content areas of the course. Targeted learning outcomes include: Apply UML notation to model complex
systems with precision and clarity.; Analyze and compare architectural styles and design patterns to solve design
problems.; Evaluate the quality of object-oriented designs using principles such as SOLID and GRASP.;
Transform requirements into robust system design artifacts, including class diagrams and sequence diagrams..
Every item has been reviewed for clinical accuracy, current guidelines, and clarity so that students can study with
confidence and self-correct as they work through the bank. Use it as a high-yield review immediately before the
exam, or as a structured practice tool during the unit - the rationales double as concise teaching notes. The
recommended writing time is 3 hours, with a passing score of 70%. Aligned with This examination adheres to the
rigorous academic standards of accredited US research universities, including ABET computing accreditation
criteria. standards and reflects the question style commonly seen on accredited program examinations. Students
Section 1: General (Questions 1-190)
1 In a system where a class must notify multiple observer objects
about state changes, but the observer set changes frequently at
runtime, which of the following design patterns best decouples the
subject from concrete observers while allowing dynamic
subscription?
A) Mediator pattern
B) Observer pattern
C) Chain of Responsibility
D) Strategy pattern
Answer: B
Rationale: The Observer pattern defines a one-to-many dependency
where subject and observers are loosely coupled, allowing dynamic
subscription. Mediator centralizes communication but does not
inherently support dynamic observer sets. Chain of Responsibility and
Strategy address different concerns.
,2 Consider the following Java-like code: `class A { void f() {
System.out.println("A"); } }` and `class B extends A { void f() {
System.out.println("B"); } }`. If both classes are in the same
package, what is the most accurate statement about the relationship
and method resolution?
A) B overrides f, and the method invoked is determined by the static
type.
B) B overloads f, and the method invoked is determined by the
dynamic type.
C) B overrides f, and the method invoked is determined by the
dynamic type.
D) B overloads f, and the method invoked is determined by the static
type.
Answer: C
Rationale: B overrides f because it has the same signature and is a
subclass. Method resolution in Java uses dynamic dispatch, so the
actual object type determines which version is invoked. Overloading
would involve different parameter lists.
3 A system has a class `Order` that directly manipulates a `Database`
object. After refactoring, `Order` now depends on an
`OrderRepository` interface, and a `DatabaseOrderRepository`
implements it. Which SOLID principle is primarily demonstrated?
A) Single Responsibility Principle
B) Open/Closed Principle
C) Liskov Substitution Principle
D) Dependency Inversion Principle
Answer: D
Rationale: Dependency Inversion Principle states that high-level
modules should not depend on low-level modules; both should depend
on abstractions. Introducing the `OrderRepository` interface inverts
the dependency. The other principles are less directly demonstrated.
,4 In a class diagram for a university enrollment system, a `Course`
class is associated with a `Student` class through an enrollment
relationship. Which of the following UML elements is most
appropriate to model the fact that a student can enroll in multiple
courses and a course can have multiple students, while also
recording the grade?
A) A many-to-many association with an association class
`Enrollment`.
B) A unidirectional association with a qualified role.
C) A composition relationship with a shared aggregate.
D) A dependency with a stereotype `«instantiate»`.
Answer: A
Rationale: An association class is used to attach attributes (like grade)
to an association itself. Many-to-many associations with additional
attributes require an association class. The other options do not
properly capture the additional data.
5 Which of the following is a primary advantage of using the
Model-View-Controller (MVC) architectural pattern in a web
application?
A) It eliminates the need for database persistence.
B) It enforces a single responsibility for each component, separating
user interface logic from business logic.
C) It allows direct database access from the view to improve
performance.
D) It ensures that the model is completely independent of the user
interface, but the controller must be a subclass of the view.
Answer: B
Rationale: MVC separates concerns: Model handles data, View
handles presentation, Controller handles input. This separation
improves maintainability and testability. The other options
misrepresent MVC's purpose and constraints.
, 6 In UML sequence diagrams, which of the following interaction
operators is used to represent a condition where a message is sent
only if a certain guard evaluates to true, and the condition is
checked at runtime?
A) alt
B) opt
C) loop
D) par
Answer: B
Rationale: The `opt` operator represents an optional interaction
fragment that executes only if its guard is true. `alt` is for alternative
fragments with multiple branches, `loop` is for repetition, and `par` is
for parallel execution.
7 A software architect is designing a system for a large-scale
distributed application that must be highly available and scalable.
Which of the following architectural styles is most appropriate?
A) Layered architecture
B) Pipe-and-filter architecture
C) Microservices architecture
D) Blackboard architecture
Answer: C
Rationale: Microservices architecture breaks down the system into
independently deployable services, which enhances scalability and
availability. Layered architecture is more monolithic, pipe-and-filter is
for data processing, and blackboard is for AI-like problems.
8 Which of the following is a key difference between aggregation and
composition in UML class diagrams?
A) Aggregation implies that the part cannot exist without the whole,
while composition implies it can.
B) Composition implies that the part cannot exist without the whole,
while aggregation implies it can.