C# Design pattern – Can any one spot the answers. 1) Which pattern is a higher-level interface that simplifies and brings together multiple interfaces of a subsystem?
a) Factory creational
b) Singleton
c) Facade
d) Abstract Factory
2) In an abstract factory design pattern
a) A concrete factory may implement factory method to create products
b) A concrete factory may be implemented using prototype design pattern to create product families
c) A concrete factory is usually a singleton class
d) All of the above.
3) Prototype design pattern is useful when the creational flexibility of objects is required and
a) when the objects to be created are determined at run time
b) When the objects to be created are replicas of existing products
c) When parallel hierarchies of factories and corresponding products are to be avoided
d) All of the above
4) “Define an interface for creating object, but let subclasses decide which class to instantiate. This pattern lets a class defer instantiation to the subclasses.”
a) This is intent of template factory design pattern
b) This is intent of the factory method design pattern
c) This is intent of the abstract factory design pattern
d) This is intent of the façade design pattern
5) Prototype design pattern is useful when the creational flexibility of objects is required and
a) when the object to be created are determined at runtime
b) when the object to be created are replicas of existing products
c) when the parallel hierarchies of factories and corresponding products has to be avoided
d) all of the above
6) Which pattern is a higher level interface that simplifies and brings together multiple instances of a subsystem?
a) Factory creational
b) Singleton
c) Facade
d) Abstract factory
7) Which of these patterns is considered to be in “class” scope?
a) Factory method
b) Abstract factory
c) Prototype
d) Builder
**8) A design pattern in which the factory class creates new classes using pre configured prototypical instances is called **
a) Prototype
b) Factory method
c) Builder
d) There is no such pattern
9) Which creational patterns are suitable for the blanks shown(in that order) _______ pattern focuses on constructing the object step by step where as ________ pattern has more to do with creational aspects of families of products.
a) Builder, Prototype
b) Abstract factory, Factory method
c) Builder, Abstract factory
d) Builder, Factory method
10) Statement A: A system should have one and only one façade Statement B: Façade design pattern can be used to decouple the subsystem from clients and other subsystems, thereby promoting portability.
a) Statement A is true, Statement B is true
b) Statement A is true, Statement B is false
c) Statement A is false, Statement B is false
d) Statement A is false, Statement B is true
11) What is true about abstract factory?
a) Abstract factory gives us an interface for creating family of products
b) Abstract factory gives us a family of interfaces for creating a single product
c) Abstract factory gives us an interface for creating a single product
d) none of the above
12) In SOA workflow and process is
a) Coordinator services for distributed, short running processes
b) Coordinator services for distributed, long running processes
c)raw compensation services
d) Logging specific events without workflow
13) Statement A: In the façade design pattern, the subsystems are not usually aware of the presence of the façade. Statement B: A façade defines a new interface whereas an adapter uses an existing interface (adapted)
a) Statement A is true, Statement B is true
b) Statement A is true, Statement B is false
c) Statement A is false, Statement B is false
d) Statement A is false, Statement B is true
14) Statement A: The intent of the Singleton design pattern is “Ensure a class has only one instance, and provide a global point of access to it” Statement B: Because a Singleton class encapsulates its sole instance, it does not have any control over how and when client access it.
a) Statement A is true, Statement B is true
b) Statement A is true, Statement B is false
c) Statement A is false, Statement B is false
d) Statement A is false, Statement B is true
15) Design pattern that provides a simplified interface to a larger body of code, such a class library is:
a) Decorator
b) Facade
c) Flyweight
d) Proxy
16) Statement A: A singleton is a behavioral design pattern Statement B: A singleton is a class scope design pattern
a) Statement A is true, Statement B is true
b) Statement A is true, Statement B is false
c) Statement A is false, Statement B is false
d) Statement A is false, Statement B is true
Could any one reply the answer for above questions.
Aucun commentaire:
Enregistrer un commentaire