Olete.in
Articles
Mock Tests
🧪 Javascript Design Patterns MCQ Quiz Hub
Javascript Design Patterns Mcq Question Set 1
Choose a topic to test your knowledge and improve your Javascript Design Patterns skills
1. Most object-oriented languages and systems provide which of these ways to create new objects?
Instantiating a class using one of its constructors
Cloning an existing object
All of the mentioned
None of the mentioned
2. Which of the following truly describes the structure of Generator pattern?
A generator pattern has a Client that needs an instance of a Product class
A Generator that creates or obtains access to such an instance on behalf of the Client
All of the mentioned
none of the mentioned
3. Which of the following is true about factory method?
A factory method is a non-constructor operation that creates and returns class instances
Factory methods are widely used in mid-level design patterns and in object-oriented programming in general
Factory methods create new instances using constructors or cloning, so they do not rely on any special technique for class instantiation
All of the Mentioned
4. When a generator assumes responsibility for product object creation in a factory method,which of the following capabilities become available?
Access to product constructors can be restricted
Private data can be provided to new product objects
Product objects can be configured after creation
All of the Mentioned
5. Which are the several reasons for using generator patterns?
Product Creation Control
Product Configuration Control
Client and Product Decoupling
All of the Mentioned
6. The Factory patterns decouple clients from products by taking advantage of interfaces in two ways?
The generator class with the factory methods cannot be changed, disallowing variability in factory method implementations
Instances of a variety of classes that implement the product interface can be returned by a factory method, allowing great flexibility in results
All of the mentioned
None of the mentioned
7. What are the types of factory pattern?
Factory Method
Abstract Method
All of the mentioned
None of the mentioned
8. Which class that can have only one instance?
Adaptor Class
Proxy Class
Singleton Class
Factory class
9. What are the drawbacks for singleton class?
Many languages do not allow classes to be values assignable to variables.
Singleton classes can be subclassed, and the singleton factory method can return a sub-class instance
Classes can easily replace only single instances
All of the internship
10. Which of the following are true for the singleton class?
Singleton classes should be used whenever it is important that only a single instance of a class exist and that that single instance be widely accessible
The Singleton pattern can also be used, with slight modifications, when a limited number of instances greater than one are desired
Access restrictions are usually easy to add by restricting the visibility of either the class or the factory method
All of the Mentioned
11. Which of the following is true for Adapter pattern?
An adapter or wrapper is a component that provides a new interface for an existing component
An Adapter or Wrapper pattern is a broker pattern that provides a new interface for existing software so that it can be reused
Adaptation for reuse is an old technique that has been used since the beginning of software development
All of the mentioned
12. The Adapter patterns provide object-oriented adapters in which of theses varieties?
One uses inheritance
one uses delegation
All of the mentioned
None of the mentioned
13. A class (the adapter class) may be given a new interface by an adapter class in which of the two ways?
The adapter may subclass the adapter. The adapter can inherit adapter operations with appropriate semantics and pragmatics, override those with inappropriate semantics or pragmatics, and add operations needed for the new interface. This is the Class Adapt
The adapter may hold a reference to the adapter and delegate must work to the adapter object. This approach is the Object Adapter pattern
All of the mentioned
None of the mentioned
14. A class (the adapter class) may be given a new interface by an adapter class in which of these ways?
Class Adapter pattern
Object Adapter pattern
All of the mentioned
None of the mentioned
15. Which of these states about Object Adapter pattern?
The adapter can inherit adapter operations with appropriate semantics and pragmatics, override those with inappropriate semantics or pragmatics, and add operations needed for the new interface
The adapter may hold a reference to the adapter and delegate must work to the adapter object
All of the mentioned
None of the mentioned
16. Which of the following is true for proxy pattern?
Has exactly the same interface as the real object
Handles routine or illegitimate messages without accessing the real object
Handles routine or illegitimate messages without accessing the real object
All of the Mentioned
17. Which of the following is not followed by proxy pattern?
virtual proxies
remote proxies
access proxies
none of the mentioned
18. What are stand-ins for objects not yet created are called?
virtual proxies
remote proxies
access proxies
None of the mentioned
19. Which of the following is incorrect with respect to the proxy pattern?
The Proxy pattern should be used whenever the services directly provided by some object need to be managed or mediated in some way without changing the object’s interface
Virtual proxies can be used to delay the creation or loading of large and time-consuming objects to preserve space and ensure rapid responses to requests
Remote proxies can hide the fact that an object is not locally present,handling the communication necessary to access the remote real object
None of the mentioned
20. Which of the following is consequence for proxy pattern?
The Proxy pattern makes it possible to defer expensive operations until they are necessary (virtual proxies)
Provides an elegant way to treat remote objects as if they were local (remote proxies)
Provides a mechanism for implementing supplier access restrictions (protection or access proxies)
All of the Mentioned
21. Which of the following are true for pattern?
It is a small collection of atomic units
They are ubiquitous throughout software development
All of the mentioned
None of the mentioned
22. Patterns are mostly used in which of the following?
Design in large
Design in Small
Coding
All of the mentioned
23. Which of the following can a pattern operate on?
Emphasize the solutions
Identify and name abstract
Provide a target for recognition
All of the Mentioned
24. What does emphasizing solution actually mean for patterns to operate?
Discovering patterns rather than inventing them
Serves as exemplars to programmers
All of the mentioned
None of the mentioned
25. Which of the factors make a pattern portable?
Creating instances of some appropriate resource at run time
Presentation of two different user interface tool-kits
All of the mentioned
none of the mentioned
26. When there is a need to implement strategy pattern?
When a single task is implemented in variety of ways
When it is dependent on nature of inputs
All of the mentioned
None of the mentioned
27. Which of the following is used in Decorator design pattern?
Broder Wrapper
Scroll Wrapper
Text View
All of the mentioned
28. Which of the following is strategy pattern dependent on?
Scalability
Modifiability
Portability
Modifiability & Portability
29. Which of the following is for factory method behavioral characteristic?
Interpreter
Template method
Iterator
None of the mentioned
30. How does a use of template allowed in components simplify things?
Reliability is enhanced
Coding time is increased
Testing is more complexed
All of the mentioned
31. How is reliability enhanced when a template is allowed in component?
Once the template is incorrect, then templatized portion of every using component is correct
Once the template is correct, then templatized portion of every using component is correct
All of the mentioned
None of the mentioned
32. How is Testing simplified when a template is allowed in component?
Each component has a standard structure
Each component has a complex structure
All of the mentioned
None of the mentioned
33. How is Flexibility enhanced when a template is allowed in the component?
Conforming components are largely interchangeable
Conforming components are not largely interchangeable
All of the mentioned
None of the mentioned
34. Why are Patterns important?
They capture expert design knowledge
They make captured design accessible to both novices and other experts
All of the mentioned
None of the mentioned
35. What benefits does patterns provide?
Novice designers can benefit from learning solution patterns that experts use, without needing design experience
Expert designers can benefit from studying patterns too: They can broaden their repertoire of patterns and deepen their understanding of the patterns they already know
All of the mentioned
None of the mentioned
36. Which of the following Choices and standardizes patterns for a problem domain promotes software reuse and, hence, quality and productivity?
Promoting Communication
Streamlining Documentation
Increasing Development Efficiency
Supporting Software Reuse
37. Which among the following are the arguments made by Alexander?
Good building design patterns are consequences of human anatomy,psychology, physiology, sociology, and politics and so are things in the world that can be discovered and verified
Great architecture has always relied on patterns, but they have never been studied systematically
Anyone can make great buildings once the patterns are known and understood
All of the Mentioned
38. Which of these are the part of 253 patterns in pattern book by Alexander?
Four-Story Limit
South-Facing Outdoors
Warm Colors
All of the Mentioned
39. What is a pattern?
It is a model proposed for imitation
It solves a software design problem
All of the mentioned
None of the mentioned
40. Which among these are the design patterns?
Architectural Styles and Programming Idioms
Mid-Level Design Patterns
Data Structures and Algorithms
All of the Mentioned
41. Which design pattern focus on the design patterns movement?
Architectural Styles
Mid-Level Design Patterns
Data Structures and Algorithms
Programming Idioms
42. Which of the following represents The (static) structure and (dynamic) behavior of the pattern?
Name
Application
Consequences
Form
43. Which of the following steps are followed for the Overview of SAAM?
Develop Scenarios
Describe Candidate Architecture
Classify Scenarios
All of the Mentioned
44. Which of the following relates to Scenarios?
Scenarios illustrate the kinds of activities that the system must support
Scenarios illustrate the kinds of changes that it is anticipated will be made to the system
All of the mentioned
None of the mentioned
45. What are the procedure followed for description of candidate architecture?
Description should be done in architectural notation that is well understood by the parties involved in the analysis
Description can be done in any notations that are well understood by the parties involved
Description may or may not be described in notations that are used for analysis
None of the mentioned
46. What are the classifications of Scenarios?
Direct Scenario
Indirect Scenario
Forward Scenario
Direct & Indirect Scenario
47. Which of the following is true?
A direct scenario cannot be assessed indirect manner by the system
Another scenario except the direct scenario requires modification before it is executed
All of the mentioned
None of the mentioned
48. What is done while performing scenario evaluation?
For indirect scenario, the changes to the architecture that are necessary for it to support the scenario must be listed
Cost of performing the change must be estimated
There should be summary table that lists all scenarios (direct and indirect)
All of the Mentioned
49. Which of the following is true?
Every direct scenario will require changing only a single component
Every indirect scenario will not require changing only a single component
Every indirect scenario will require changing only a single component
None of the mentioned
50. Why is scenario interaction important?
It exposes the allocation of functionality to the product’s design
It follows a communication path which leads to systems stability
It achieves main goal of modifiability
None of the mentioned
Submit