250+ TOP MCQs on Software Design Pattern and Answers

Software Engineering Multiple Choice Questions on “Software Design Pattern”.

1. Which mechanism is applied to use a design pattern in an OO system?
a) Inheritance
b) Composition
c) All of the mentioned
d) None of the mentioned

Answer: c
Clarification: Using inheritance, an existing design pattern becomes a template for a new subclass.Composition is a concept that leads to aggregate objects.

2. Design patterns does not follow the concept of software reuse.
a) True
b) False

Answer: b
Clarification: Design patterns allow the designer to create the system architecture by integrating reusable components.

3. The use of design patterns for the development of object-oriented software has important implications for
a) Component-based software engineering
b) Reusability in general
c) All of the mentioned
d) None of the mentioned

Answer: c
Clarification: None.

4. Which of the following is a design pattern?
a) Behavioral
b) Structural
c) Abstract Factory
d) All of the mentioned

Answer: d
Clarification: All the options are design patterns so option d.

5. You want to minimize development cost by reusing methods? Which design pattern would you choose?
a) Adapter Pattern
b) Singleton Pattern
c) Delegation pattern
d) Immutable Pattern

Answer: c
Clarification: The delegation pattern is a design pattern in OOP where an object, instead of performing one of its stated tasks, delegates that task to an associated helper object.

6. You want to avoid multiple inheritance. Which design pattern would you choose?
a) Abstraction-Occurrence Pattern
b) Player-Role Pattern
c) General Hierarchy Pattern
d) Singleton Pattern

Answer: b
Clarification: The answer is self-explanatory.

7. The recurring aspects of designs are called design
a) patterns
b) documents
c) structures
d) methods

  250+ TOP MCQs on Object Oriented Design using UML and Answers

Answer: a
Clarification: A pattern is the outline of a reusable solution to a general problem encountered in a particular context.

8. Design pattern is a solution to a problem that occurs repeatedly in a variety of contexts.
a) True
b) False

Answer: a
Clarification: Each design pattern has a name and use of each pattern has consequences.

9. Which pattern prevents one from creating more than one instance of a variable?
a) Factory Method
b) Singleton
c) Observer
d) None of the mentioned

Answer: b
Clarification: In singleton pattern, the class itself is made responsible for keeping track of its instance.Thus it ensures that no more than one instance is created.

10. Facade pattern promotes weak coupling between subsystem and its clients.
a) True
b) False

Answer: a
Clarification: It is one of the patterns benefit.The facade pattern shields clients from subsystem classes and reduces the number of objects that clients deal with.

11. Which design pattern defines one-to-many dependency among objects?
a) Singleton pattern
b) Facade Pattern
c) Observer pattern
d) Factory method pattern

Answer: c
Clarification: Observer pattern defines one-to-many dependency among objects so that when one object changes its state, all its dependents are notified.

12. Facade pattern couples a subsystem from its clients.
a) True
b) False

Answer: b
Clarification: A facade can be a single entry point to each subsystem level. It decouples the subsystem.

13. In factory method pattern, the framework must instantiate classes but it only knows about the abstract classes, which it cannot initiate. How would one solve this problem?
a) encapsulating the knowledge of which document subclass to is to be created and
b) moving this knowledge out of the framework
c) instantiating the application specific documents without knowing their class
d) all of the mentioned

  250+ TOP MCQs on Web Engineering Project Metrics and Answers

Answer: d
Clarification: Following all the options in order will solve the factory method problem.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top