Top 350+ Solved software design modeling (SDM) MCQ Questions Answer
Q. Which pattern is most appropriate when a decision must be made at the time a class is instantiated?
a. bridge
b. composite
c. factory method
d. command
Q. It is also known as Virtual Constructor and it is used to define an interface for creating an object but letting the subclass decide which class to instantiate, this pattern is :
a. builder
b. abstract factory
c. prototype
d. factory method
Q. You want all the clients using class A to use the same instance of class A, what should you do to achieve this goal?
a. mark class a final
b. mark class a abstract
c. apply the singleton pattern to class a
d. apply the memento pattern to class a
Q. Which design pattern you would you use to have a prototypical instance determine the concrete class of object being created?
a. prototype factory design pattern
b. virtual prototype design pattern
c. abstract prototype design pattern
d. prototype design pattern
Q. Which design pattern you would you use to decouple the creation procedure of a complex object from it's concrete instance to be able to apply that procedure on variety of implementations.
a. factory builder design pattern
b. method builder design pattern
c. builder design pattern
d. factory method design pattern
Q. What would lead you to apply the builder design pattern?
a. to abstract steps of construction of objects so that different implementations
b. to apply the same object construction procedure on variety of representations
c. both 1 & 2
d. none of above
Q. To implement the Singleton design pattern specify all the needed steps ............
a. add final modifier to the class declaration
b. add private or protected modifier to the constructor declaration
c. introduce a static getter method for the singleton instance
d. all of above
Q. Which design pattern you would you use to control the creation of an object based on a established interface, while allowing the concrete implementation to determine the subclass to construct.
a. singleton design pattern
b. builder factory design pattern
c. prototype factory design pattern
d. factory method design pattern
Q. The factory method design pattern is also known as:
a. abstract factory
b. abstract constructor
c. virtual factory
d. virtual constructor
Q. Which of the following are participants in the GOF builder design pattern?
a. creator
b. refined abstraction
c. abstract factory
d. none of above
Q. Which design pattern is used in the Java InputStream and OutputStream hierarchies?
a. adapter design pattern
b. decorator design pattern
c. composite design pattern
d. singleton design pattern
Q. What object should have the responsibility, when you do not want to violate High Cohesion and Low Coupling, or other goals, but solutions offered by Expert are not appropriate?
a. pure fabrication
b. indirection
c. creator
d. polymorphism
Q. When would you use the GOF Decorator design pattern?
a. to translates an existing class interface into a compatible target interface
b. to assign more functionality to an object without sub-classing it
c. to decouple an abstraction from its implementation so that the two can vary independently
d. to nest layers of decorators to add more functionality
Q. When would you use the GOF Composite design pattern?
a. to decouple an abstraction from its implementation so that the two can vary independently
b. to translates an existing class interface into a compatible target interface
c. to arrange object hierarchies such that the client code can access both the individual objects and compositions in a uniform manner
d. to improve the system overall performance