Вы находитесь на странице: 1из 5

Design Pattern MCQS (11-20)

Lecture – 11
1. Participant that construct an object using builder interface in builder design pattern is

a. Director b. Product c. ConcreteBuilde d. Builder


r

2. Design pattern that provides a fine control over the construction process and provides clear
separation between the construction and representation of an object.

a. Factory b. Builder c. Facade d. Interpretor

3. __________ builds the product’s internal representation and defines the process by which its
assembled in builder design pattern.

a. Director b. Product c. ConcreteBuilde d. Builder


r

Lecture – 12
4. Motivation of which design pattern can be applied to reduce the load on memory by sharing
objects.

a. Flyweight b. Prototype c. Adapter d. Observer

5. Which of the following is true about Flyweight design pattern?

a. Used when an application used b. Used when application doesn’t


number of objects depend on object identity
c. Used when the storage cost is high d. All of Given

6. Which of the following design pattern is use sharing to support large number of fine-grained
objects efficiently?

a. Decorator b. Flyweight c. Mediator d. Factory

Lecture – 13
7. Suppose we have a pen can exist with/without refill. A refill can be of any color thus a pen is
used to create drawing having N of colors. Here pen can be ______ object with refill as extrinsic
attribute

a. Singleton b. Flyweight e. Template f. Bridge

8. Attribute that is related to the physical aspects of an object is

a. Intrinsic b. Logical c. Extrinsic d. None of these

9. Attribute that is related to the logical aspects of an object is

a. Intrinsic b. Physical c. Extrinsic d. None of these

Lecture – 14
10. When we want to represent a full or partial hierarchy of objects, _________ pattern is used.

a. Composite b. Iterator c. Bridge d. Prototype

11. Which design pattern lets client treat individual objects and combination of objects uniformly.

a. State b. Proxy c. Composite d. Visitor

12. Which participant in composite pattern defines behavior for primitive objects in the composition.

a. Component b. Leaf c. Composite d. Client

Lecture – 15
13. The constructor in the composite design pattern should be private.

a. True b. False

14. Method that is used to show output of employee in java is

Cout<<employee; Print(employee); System.out.println(employee); None


15. The structure of composite design pattern is

a. Star b. Ring c. Bus d. Tree

Lecture – 16
16. When we want to decouple a request’s sender and receiver, we use which design pattern.

a. Chain of Responsibility b. Facade c. Bridge d. Prototype

17. Chain of responsibility is used to issue a request to one of several objects without specifying the
___________ explicitly.

a. Sender b. Receiver c. Successor d. Client

18. Which design pattern provides the advantage of avoid coupling degree, simplified object and
allow dynamic adding or deleting responsibility.

a. Chain of Responsibility b. Bridge c. Mediato d. Proxy


r

Lecture – 17
19. Avoid coupling of sender request in the characteristics of

a. Facade b. Singleton c. Builder d. None of these

20. Object that initiate to a ConcreteHandler object on the chain is

a. Handler b. Decorator c. Client d. Sender

21. The object does not need to know the chain structure is the advantage of composite pattern

a. Ture b. False

Lecture – 18
22. Proxy design pattern is also known as
e. Surrogate f. Handle g. Wrappers h. All of these

23. Provides a surrogate or placeholder for another object to control access to it.

e. Iterator f. Decorator g. Proxy h. State

24. This proxy may cache additional information about the real subject so that they can postpone
accessing it.

c. Remote d. Virtual e. Protection f. None

Lecture – 19
25. The following diagram is the problem statement of which design pattern

a. Observer b. Command c. Factory d. Proxy

26. There are how many types of proxy design pattern.

a. Two b. Three c. Four d. Five

27. Proxy design pattern is type of following pattern

a. Creational b. Structural c. Behavioral d. None

Lecture – 20
28. Object that asks the command to carry out request is

a. Concrete b. Receiver c. Wrapper d. Invoker

29. The functionality of UNDO/REDO operation is provided by which design pattern so we can
possibly reverse the operation.
a. Builder b. Command c. Iterator d. Composite

30. Action and Transaction is an alternate name of __________ pattern.

a. Facade b. Command c. Decorator d. Singleton

Вам также может понравиться