Creational Design Patterns . Net_10 June

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By James Richardson
J
James Richardson
Community Contributor
Quizzes Created: 13 | Total Attempts: 11,292
| Attempts: 754
SettingsSettings
Please wait...
  • 1/10 Questions

    What is the reason for studying design pattern?

    • Patterns makes it possible to reuse solutions
    • Patterns help with communication between analysts
    • Patterns give you perspective on the problem
    • All of the above
Please wait...
About This Quiz

Explore the essentials of design patterns in. NET with this quiz on June 10. Assess your understanding of their purpose, structure, and application in software development. This quiz evaluates knowledge on design reuse and correct pattern utilization, crucial for effective software architecture.

Creational Design Patterns . Net_10 June - Quiz

Quiz Preview

  • 2. 

    Patterns are the devices that allow programs to share knowledge about their ___

    • Code

    • Design

    • Analysis

    • None

    Correct Answer
    A. Design
    Explanation
    Patterns are the devices that allow programs to share knowledge about their design. Design patterns provide solutions to common design problems and enable programmers to create reusable and maintainable code. By using design patterns, programmers can leverage existing knowledge and best practices to improve the overall quality and efficiency of their software designs.

    Rate this question:

  • 3. 

    Which of the following are among ten things, which the basic templates of GoF design pattern include?

    • Problem

    • Context

    • Forces

    • All of the above

    Correct Answer
    A. All of the above
    Explanation
    The correct answer is "All of the above" because the basic templates of GoF design patterns include problem, context, and forces. These three elements are essential in understanding and applying design patterns effectively. The problem refers to the specific issue or challenge that the design pattern aims to solve. The context provides the background and environment in which the problem exists. The forces are the constraints and considerations that influence the design decisions. Therefore, all three elements are necessary components of the basic templates of GoF design patterns.

    Rate this question:

  • 4. 

    1. Which are NOT the possible errors of using design patterns?

    • Superficiality

    • Cohesion

    • Fit

    • Misdiagnosis

    Correct Answer
    A. Cohesion
    Explanation
    The possible errors of using design patterns include superficiality, fit, and misdiagnosis. However, cohesion is not considered an error when using design patterns. Cohesion refers to the degree to which the elements within a module or class belong together and work together towards a common goal. It is a desirable quality in software design and not considered an error.

    Rate this question:

  • 5. 

    Design patterns have to be object oriented?

    • True

    • False

    Correct Answer
    A. False
    Explanation
    Design patterns do not have to be object-oriented. While many design patterns are commonly used in object-oriented programming, there are also design patterns that can be applied in other programming paradigms such as functional programming or procedural programming. Design patterns are general reusable solutions to common problems in software design, and they can be adapted and used in various programming paradigms depending on the specific problem at hand.

    Rate this question:

  • 6. 

    Design patterns enables ____ reuse

    • Design

    • Architecture

    • Application Logic

    Correct Answer
    A. Design
    Explanation
    Design patterns enable code reuse.

    Rate this question:

  • 7. 

    1. Which of following patterns is not used to create an object?

    • Factory method

    • Strategy

    • Prototype

    • Abstract Factory

    Correct Answer
    A. Strategy
    Explanation
    The Strategy pattern is not used to create an object. The Strategy pattern is a behavioral design pattern that allows selecting an algorithm at runtime. It defines a family of algorithms, encapsulates each one, and makes them interchangeable. It is used to provide different strategies for solving a problem. However, it does not involve the creation of objects itself.

    Rate this question:

  • 8. 

    Which design pattern is also called anti pattern?

    • Factory method

    • Singleton

    • Prototype

    • Abstract Factory

    Correct Answer
    A. Singleton
    Explanation
    The Singleton design pattern is often referred to as an anti-pattern because it can introduce global state and tightly couple different parts of the codebase. It can make the code harder to test, maintain, and extend. The use of a Singleton can also hinder parallelism and make it difficult to achieve proper separation of concerns. Therefore, while the Singleton pattern can be useful in certain scenarios, it is generally considered an anti-pattern due to its potential drawbacks.

    Rate this question:

  • 9. 

    What is the key strategy in the Abstract factory?

    • Find what varies and encapsulate it

    • Favour aggregation over inheritance

    • Design to interfaces, not to implementations

    • All of the above

    Correct Answer
    A. All of the above
    Explanation
    The key strategy in the Abstract factory is to implement all of the given options. "Find what varies and encapsulate it" refers to identifying the varying parts of an object and encapsulating them into separate classes. "Favour aggregation over inheritance" suggests using composition and object aggregation instead of relying solely on inheritance. "Design to interfaces, not to implementations" emphasizes programming to interfaces rather than concrete implementations, allowing for flexibility and interchangeability. Implementing all of these strategies helps in creating a flexible and maintainable codebase.

    Rate this question:

  • 10. 

    1. What is the factory implementation in C#?

    • GetObject()

    • GetEnumerator()

    • GetType()

    • None of the above

    Correct Answer
    A. GetEnumerator()
    Explanation
    The GetEnumerator() method is the factory implementation in C#. This method is used to create and return an enumerator object, which allows for iterating over a collection of objects. It is commonly used in conjunction with the foreach loop to iterate through elements in a collection. The other options (GetObject(), GetType(), and None of the above) are not related to factory implementation in C#.

    Rate this question:

Quiz Review Timeline (Updated): Mar 22, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jun 06, 2013
    Quiz Created by
    James Richardson
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.