Top 350+ Solved software design modeling (SDM) MCQ Questions Answer

From 391 to 405 of 445

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

  • c. 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

  • c. apply the singleton 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

  • 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

  • c. builder 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

  • c. both 1 & 2

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

  • 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

  • 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

  • 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

  • a. creator

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

  • b. decorator design pattern

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

  • b. to assign more functionality to an object without sub-classing it

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

  • c. to arrange object hierarchies such that the client code can access both the individual objects and compositions in a uniform manner
Subscribe Now

Get All Updates & News