Quiznetik

Software Design Modeling (SDM) | Set 2

1. GRASP stands for _______________.

Correct : B. general responsibility assignment software patterns

2. There are _______ GRASP patterns.

Correct : C. 9

3. ____________ object which receives request from UI layer object and then controls/coordinates with other object.

Correct : B. controller

4. Controller class is called _____________, if the class is overloaded with too many responsibilities.

Correct : B. bloated

5. Benefit of ______________ is handling new variations will become easy.

Correct : C. polymorphism

6. Benefit of Pure Fabrication is _______________

Correct : D. all of above

7. A ___________ is a class that does not represent a concept in the problem domain.

Correct : C. pure fabrication

8. Type of design patterns that provide solution for the better interaction between objects is ______________

Correct : C. behavioral

9. Which design pattern provides a single class which provides simplified methods required by client and delegates call to those methods?

Correct : C. facade pattern

10. Which design pattern ensures that only one object of particular class gets created?

Correct : A. singleton pattern

11. Which design pattern suggests multiple classes through which request is passed and multiple but only relevant classes carry out operations on the request?

Correct : C. state pattern

12. Which design pattern works on data and action taken based on data provided?

Correct : A. command pattern

13. Facade pattern promotes weak coupling between subsystem and its clients.

Correct : A. true

14. Which of the following are levels of design focus that can be used to categorize WebApp patterns?

Correct : D. both a &c

15. Which one pattern creating duplicate object?

Correct : B. prototype pattern

16. In which of the following pattern, a visitor class is used which changes the executing algorithm of an element class?

Correct : A. visitor pattern

17. A pattern language ______________

Correct : A. encompasses a collection of patterns

18. Most user interface design patterns fall with in one of ____ categories of patterns.

Correct : B. 10

19. The ___________used to ease the construction of a complex object from simple objects.

Correct : A. builder pattern

20. The ___________ is used to translate the interface of one class into another interface.

Correct : D. adapter pattern

21. ________________ makes a clear-cut between abstraction and implementation.

Correct : D. bridge pattern

22. The _____________ helps you to create tree structures of objects.

Correct : B. composite pattern

23. Scope based classification decided if the pattern applies to mainly classes or objects.

Correct : A. true

24. Use ___________ when you need to define a family of algorithms, encapsulate each one, and make them interchangeable.

Correct : C. strategy pattern

25. The __________ allows an object to alter its behavior when its internal state changes.

Correct : B. state pattern

26. In which of the following pattern, a null object replaces check of NULL object instance?

Correct : B. null object pattern

27. In which of the following pattern, a visitor class is used which changes the executing algorithm of an element class?

Correct : A. visitor pattern

28. Which of the following represents The (static) structure and (dynamic) behavior of the pattern?

Correct : D. form

29. Which of the following is not one of the elements of a design pattern?

Correct : D. solution

30. Define a family of algorithms, encapsulate each one, and make them interchangeable. It lets the algorithm vary independently from clients that use it.

Correct : C. strategy

31. Encapsulate a request as an object, there by letting you parametrize clients with different requests, queue or log requests, and support undoable operation.

Correct : B. command

32. Which design pattern is used in the Java Database connectivity JDBC(TM)?

Correct : B. factory method design pattern

33. Which design pattern you would you use to limit the class instantiation to one object?

Correct : D. singleton design pattern

34. Which of the following patterns allows multiple objects an opportunity to process a request without guaranteeing that any of them must process it?

Correct : A. chain of responsibility

35. Which of the following is an object pattern that encapsulates interchangeable algorithms in objects so the algorithm can vary independently of the classes that use it?

Correct : B. strategy

36. A pattern that is intended to provide a means to define a family of algorithms and encapsulate each one as an object for interchangeable use

Correct : A. strategy pattern

37. Which GRASP pattern is suitbale to handle alternatives based on type?

Correct : C. polymorphism

38. A concrete class must have ...........

Correct : B. program code for all of its methods

39. It is also known as Wrapper, it is used when subclassing is not possible or practical to add functionality and it is used to add functionality at runtime. This pattern is

Correct : B. decorator

40. The Proxy pattern deals with situations where you have a complex object or it takes a long time to create the object.

Correct : A. true

41. The main advantage of design patterns:

Correct : D. all of above

42. Which Design Pattern should you use when you want to parameterize objects by an action to perform.

Correct : A. command

43. Which Design Pattern should you use whenyou want to represent part-whole hierarchies of objects.

Correct : A. composite

44. Which Design Pattern should you use when an application uses a large number of objects and the storage costs are high because of the sheer quantity of objects.

Correct : D. composite

45. Which Design Pattern should you use when more than one object may handle a request, and the handler isn't known a priori. The handler should be ascertained automatically.

Correct : B. chain of responsibility

46. Which GRASP pattern helps to find out answer for “Who should be responsible for creating a new instance of some class?"

Correct : C. creator

47. ___________ is a measure of how strongly one element is connected to, has knowledge of, or relies on other elements.

Correct : A. coupling

48. A _____________ system is one in which each of its components has little or no knowledge of the definitions of other separate components.

Correct : C. loosely coupled

49. In Low coupling two elements are coupled, if ______________________.

Correct : C. both a&b

50. We can make an object as Controller, if ___________________

Correct : C. both a&b

51. A good software will have _____________.

Correct : C. both a&b

52. The indirection pattern supports _____________

Correct : C. both a&b

53. Which design pattern defines one-to-many dependency among objects?

Correct : C. observer pattern

54. Which of the following is correct about Factory design pattern.

Correct : D. all of the above

55. Attach additional responsibilities to an object dynamically.It provides a flexible alternative to subclassing for extending functionality.

Correct : C. decorator

56. Which of the following describes the Facade pattern correctly?

Correct : C. this pattern hides the complexities of the system and provides an interface to the client using which the client can access the system

57. The use of design patterns for the development of object-oriented software has important implications for ____________

Correct : C. all of the above

58. In which of the following pattern a class represents functionality of another class?

Correct : A. proxy pattern

59. The client software uses the ___________ which provides an interface for creating families related or dependent objects.

Correct : B. abstract factory

60. Which pattern is used when configuring an application with classes dynamically.

Correct : C. prototype pattern

61. ___________ pattern ensure a class only has one instance and provide a global point of access to it.

Correct : A. singleton pattern

62. The ____________ is often employed when there is a need to use different sets of objects and where the objects could be added or changed some time during the lifetime of an application.

Correct : A. abstract factory

63. Which pattern is used When an object wants to publish information and many objects will need to receive that information.

Correct : C. observer pattern

64. A ___________ is an object that stores a snapshot of the internal state of another object.

Correct : B. memento

65. Which of the following describes the Command pattern correctly?

Correct : D. in this pattern a request is wrapped under an object as command and passed to invoker object.

66. Which design pattern provides a single class which provides simplified methods required by client and delagates call to those methods?

Correct : C. facade pattern

67. Which of the following Chooses and standardizes patterns for a problem domain promotes software reuse and, hence, quality and productivity?

Correct : D. supporting software reuse

68. Which design pattern suggest multiple classes through which request is passed and multiple but only relevant classes carry out operations on the request?

Correct : B. chain of responsibility pattern

69. Which of the following are levels of design focus that can be used to categorize WebApp patterns?

Correct : C. navigation patterns

70. Which pattern is most appropriate when a decision must be made at the time a class is instantiated?

Correct : C. factory method

71. 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 :

Correct : D. factory method

72. You want all the clients using class A to use the same instance of class A, what should you do to achieve this goal?

Correct : C. apply the singleton pattern to class a

73. Which design pattern you would you use to have a prototypical instance determine the concrete class of object being created?

Correct : D. prototype design pattern

74. 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.

Correct : C. builder design pattern

75. What would lead you to apply the builder design pattern?

Correct : C. both 1 & 2

76. To implement the Singleton design pattern specify all the needed steps ............

Correct : D. all of above

77. 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.

Correct : D. factory method design pattern

78. The factory method design pattern is also known as:

Correct : D. virtual constructor

79. Which of the following are participants in the GOF builder design pattern?

Correct : A. creator

80. Which design pattern is used in the Java InputStream and OutputStream hierarchies?

Correct : B. decorator design pattern

81. 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?

Correct : A. pure fabrication

82. In the Publish-Subscribe messaging model, the subscribers register themselves in a topic and are notified when new messages arrive to the topic. Which pattern does most describe this model?

Correct : C. observer

83. When would you use the GOF Decorator design pattern?

Correct : B. to assign more functionality to an object without sub-classing it

84. When would you use the GOF Composite design pattern?

Correct : C. to arrange object hierarchies such that the client code can access both the individual objects and compositions in a uniform manner

85. What are the advantages of Factory objects?

Correct : D. all of above

86. Classes that contain strongly related functionalities are described as having ____________.

Correct : A. high cohesion

87. You want to minimize development cost by reusing methods? Which design pattern would you choose?

Correct : C. delegation pattern

88. Can We Create A Clone Of A Singleton Object?

Correct : A. true

89. Which of the following describes the Builder pattern correctly?

Correct : A. this pattern builds a complex object using simple objects and using a step by step approach.

90. Which of the following describes the MVC pattern correctly?

Correct : B. this pattern is used to separate application\s concerns.

91. Which of the following is correct about Structural design patterns.

Correct : B. these design patterns concern class and object composition. concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionalities.

92. Which of the following describes the Filter pattern correctly?

Correct : B. this pattern refers to creating duplicate object while keeping performance in mind.

93. Which of the following describes the Flyweight pattern correctly?

Correct : C. this pattern is primarily used to reduce the number of objects created and to decrease memory footprint and increase performance.

94. Which of the following describes the Behavioral pattern correctly?

Correct : C. this type of pattern are specifically concerned with communication between objects.

95. Given the following scenario: You want to create families of related objects, to be used interchangeably to configure you application. What is most appropriate GoF pattern to use?

Correct : B. abstract factory

96. What are the consequences of applying the GOF Singleton pattern?

Correct : A. it introduces thread safety issue when the singleton instance is instantiated on demand

97. What are the consequences of applying the abstract factory patter?

Correct : D. both 2 & 3

98. Which GOF design pattern is applied in the code snippet below? public class PrintSpooler { private static final PrintSpooler INSTANCE = new PrintSpooler(); private PrintSpooler() {} public static PrintSpooler getInstance() { return INSTANCE; } }

Correct : B. singleton design pattern

99. What is a software architectural pattern?

Correct : D. a recurring architecture used in a variety of systems

100. Which of the following term is best defined by the statement:”The client sends structured query language (SQL) requests to the server which are transmitted as messages across the net”?

Correct : B. database servers