This set of Software Engineering Multiple Choice Questions & Answers (MCQs) focuses 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: None.
4. Which of the following is a design pattern?
a) Behavioral
b) Structural
c) Abstract Factory
d) All of the mentioned
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: The answer is self-explanatory.
7. The recurring aspects of designs are called design
a) patterns
b) documents
c) structures
d) methods
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: Following all the options in order will solve the factory method problem.
Sanfoundry Global Education & Learning Series – Software Engineering.
Here’s the list of Best Books in Software Engineering.
- Practice BCA MCQs
- Check Computer Science Books
- Apply for Computer Science Internship
- Check Software Engineering Books
- Practice Information Technology MCQs