Quiz 1 Design Pattern
Quiz 1 Design Pattern
a. Pattern name.
b. Suggestions
c. Problem
d. Solution
2:- Problem will include a list of conditions that must be meet _____ it makes sense to apply the pattern.
a. After
b. At the end of
c. Before
d. None
a. Associations
b. Relationships
c. Responsibilities
d. All of given
5:- We can create a fully encapsulated class in Java by making all the data members of the class ______.
a. Public
b. Protected
c. Private
d. Partnership
6:- The mechanism by which an object acquires the properties of another object is called.
a. Encapsulation
b. Abstraction
c. Inheritance
d. Polymorphism
a. True
b. False
c. Probably
d. Probably not
10:- The pattern's _______ conveys the essence of the pattern succinctly.
a. Intent
b. Motivation
c. Name
d. Name and motivation
a. Adapter
b. Bridge
c. Composite
d. All of above
13:- When classes delegate responsibility to one of several helper subclasses, and you want to localize
the knowledge of which helper subclass is the delegate we use.
a. Interpreter method
b. Template method
c. Factory method
d. Adapter method
14:- What will you use when you want to provide a class library of products, and you want to reveal just
their interfaces, not their implementation.
a. Template pattern
b. Factory pattern
c. Adapter pattern
d. Abstract factory pattern
a. Factory design pattern provides approach to code for interface rather than implementation.
b. Factory pattern removes the instantiation of actual implementation classes from client code.
c. Factory pattern provides abstraction between implementation and client classes through
inheritance.
d. All of above
a. Wrapper
b. Kit
c. Virtual constructor
d. Abstraction
17:- Sometimes a class that's designed for reuse isn't reusable only because its interface doesn't match
18:- American socket and plug are different from British. Their interface are not compatible with one
another. British plugs are cylindrical and American plugs are rectangular. You can use an _______ in
between to fit an American (rectangular) plug in British (cylindrical) socket assuming voltage
requirements are met with.
a. A&C
b. Adapter
c. Electric plug
d. Power bank
19:- Facade design pattern defines a __________ interface that make a subsystem easier to use.
a. High level
b. Low level
c. Simple
d. Both a and c
a. Adapter
b. Bridge
c. Prototype
d. Façade
22:- When you want to transparently and dynamically add responsibilities on an object without affecting
other objects you use?
24:- Other than decorator pattern there is a way to add responsibilities on an object through.
a. Inheritance
b. Encapsulation
c. Abstraction
d. Polymorphism
25:- The better approach would be to clone an existing object into a new object and then do the:
a. Data implementation
b. Data mining
c. Data manipulation
d. Data extraction
a. Ice-cream
b. Home
c. Charger
d. Internet
a) Creational patterns
b) Structural patterns
c) Behavioral patterns
d) Java patterns