Important Trivia Quiz On Design Pattern

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Nyssa007
N
Nyssa007
Community Contributor
Quizzes Created: 6 | Total Attempts: 5,966
Questions: 20 | Attempts: 478

SettingsSettingsSettings
Important Trivia Quiz On Design Pattern - Quiz

Here is an Important Trivia Quiz on Design Pattern that is guaranteed to refresh your memory of the topic. A design pattern is basically a solution that is given to a commonly occurring problem in software if it not fully developed software. Take up the quiz and be sure to refer to your book on some of the questions you get wrong!


Questions and Answers
  • 1. 

    ____ methods retrieve and update attribute values. 

    • A.

      Overloaded

    • B.

      B. Get and set

    • C.

      Constructor

    • D.

      Data

    Correct Answer
    B. B. Get and set
    Explanation
    Get and set methods are used to retrieve and update attribute values in object-oriented programming. The get method is used to retrieve the value of an attribute, while the set method is used to update or modify the value of an attribute. These methods provide a way to access and manipulate the attributes of an object, ensuring encapsulation and data integrity. By using get and set methods, the attributes of an object can be accessed and modified in a controlled and consistent manner.

    Rate this question:

  • 2. 

    The prototype pattern is a ____ pattern. 

    • A.

      a. structural class-level

    • B.

      b. creational object-level

    • C.

      c. creational class-level

    • D.

      d. behavioral object-level

    Correct Answer
    B. b. creational object-level
    Explanation
    The prototype pattern is a creational object-level pattern. This pattern involves creating objects by cloning or copying existing objects, rather than creating new objects from scratch. It allows for the creation of new objects with different initial values or configurations, while avoiding the overhead of creating new objects from scratch.

    Rate this question:

  • 3. 

    Which of the following is a responsibility of a view layer class? 

    • A.

      a. Display electronic forms and reports.

    • B.

      b. Establish and maintain connections to the database.

    • C.

      c. Prepare persistent classes for storage to the database.

    • D.

      d. Process all business rules with appropriate logic.

    Correct Answer
    A. a. Display electronic forms and reports.
    Explanation
    The responsibility of a view layer class is to display electronic forms and reports. This means that the view layer class is responsible for presenting the user interface to the user, allowing them to interact with the application and view the necessary information in the form of electronic forms and reports. This responsibility does not involve establishing and maintaining connections to the database, preparing persistent classes for storage, or processing business rules with appropriate logic.

    Rate this question:

  • 4. 

     In a communication diagram, a(n) ____ always directly follows the sequence number. 

    • A.

      a. equal sign

    • B.

      Semicolon

    • C.

      Colon

    • D.

      Dash

    Correct Answer
    C. Colon
    Explanation
    In a communication diagram, a colon always directly follows the sequence number. This is because the colon is used to separate the sequence number from the message or action being performed by the object in the diagram. It helps to clearly indicate the order of communication between objects and ensures that the diagram is easily understandable.

    Rate this question:

  • 5. 

    Communication diagrams and sequence diagrams are both ____ diagrams, and they capture ____ information. 

    • A.

      a. interaction, the same

    • B.

      b. interaction, different

    • C.

      c. data flow, the same

    • D.

      d. data flow, different

    Correct Answer
    A. a. interaction, the same
    Explanation
    Communication diagrams and sequence diagrams are both interaction diagrams, as they both depict the interactions between objects in a system. They capture the same information, which includes the messages exchanged between objects and the order in which these messages occur.

    Rate this question:

  • 6. 

    The ____ pattern is a behavioral object-level pattern. 

    • A.

      Singleton

    • B.

      Proxy

    • C.

      Bridge

    • D.

      Strategy

    Correct Answer
    D. Strategy
    Explanation
    The strategy pattern is a behavioral object-level pattern that allows different algorithms or strategies to be selected at runtime. It defines a family of algorithms, encapsulates each one, and makes them interchangeable. This pattern promotes loose coupling between the client and the algorithms, as the client can switch between strategies without modifying its code.

    Rate this question:

  • 7. 

    Which of the following is a responsibility of a data access layer class? 

    • A.

      a. Accept input data.

    • B.

      b. Create problem domain (persistent) classes.

    • C.

      c. Disconnect gracefully from the database.

    • D.

      d. Process all business rules with appropriate logic.

    Correct Answer
    C. c. Disconnect gracefully from the database.
    Explanation
    A data access layer class is responsible for managing the connection between the application and the database. It is responsible for establishing a connection to the database, executing queries or commands to retrieve or update data, and closing the connection when it is no longer needed. Disconnecting gracefully from the database ensures that any resources are released properly and any pending transactions are committed or rolled back. This helps to maintain the integrity and efficiency of the database operations.

    Rate this question:

  • 8. 

     In a communication diagram, true/false conditions are contained in ____. 

    • A.

      Braces

    • B.

      Parentheses

    • C.

      c. quotation marks

    • D.

      Brackets

    Correct Answer
    D. Brackets
    Explanation
    In a communication diagram, true/false conditions are contained in brackets. Brackets are commonly used to enclose conditions or expressions in programming languages, and in the context of a communication diagram, they serve the same purpose. They help to clearly define and represent the conditions or expressions being communicated between different elements or actors in the diagram.

    Rate this question:

  • 9. 

     Design patterns became a widely accepted object-oriented design technique in 1996 when the ____ published Elements of Reusable Object-Oriented Software. 

    • A.

      a. Group of Five

    • B.

      b. MIT Media Lab

    • C.

      c. Object-Oriented Consortium

    • D.

      d. Gang of Four

    Correct Answer
    D. d. Gang of Four
    Explanation
    In 1996, the book "Elements of Reusable Object-Oriented Software" was published, which introduced design patterns as a widely accepted object-oriented design technique. This book was written by a group of four authors, Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides, who are commonly referred to as the Gang of Four (GoF). Therefore, the correct answer is d. Gang of Four.

    Rate this question:

  • 10. 

    ____ is a design principle to segregate classes into separate components based on the primary focus of the classes. 

    • A.

      a. Realization of use cases

    • B.

      b. Separation of responsibilities

    • C.

      c. Dependency relationships

    • D.

      Indirection

    Correct Answer
    B. b. Separation of responsibilities
    Explanation
    Separation of responsibilities is a design principle that involves dividing classes into separate components based on their primary focus. This helps to ensure that each class is responsible for a specific task or functionality, making the code more modular and easier to understand and maintain. This principle promotes better organization and reduces the complexity of the system by avoiding classes that have multiple responsibilities.

    Rate this question:

  • 11. 

    A(n) ____ diagram in UML is simply a high-level diagram that allows designers to associate classes of related groups. 

    • A.

      a. entity-relationship

    • B.

      Package

    • C.

      Message

    • D.

      d. use case controller

    Correct Answer
    B. Package
    Explanation
    A package diagram in UML is a high-level diagram that allows designers to associate classes of related groups. It is used to organize and structure the elements of a system, such as classes, interfaces, and other packages. The diagram visually represents the relationships and dependencies between these elements, making it easier to understand and manage the system's architecture.

    Rate this question:

  • 12. 

    Over the last few years, powerful ____ (IDE) tools have been developed to help programmers construct systems. 

    • A.

      a. Internet development entity

    • B.

      b. Internet development environment

    • C.

      c. integrated development entity

    • D.

      d. integrated development environment

    Correct Answer
    D. d. integrated development environment
    Explanation
    Over the last few years, powerful integrated development environment (IDE) tools have been developed to help programmers construct systems. An IDE is a software application that provides comprehensive facilities to computer programmers for software development. It typically consists of a source code editor, build automation tools, and a debugger. IDEs make it easier for programmers to write, test, and debug code by providing a unified interface and a set of integrated tools. Therefore, option d, integrated development environment, is the correct answer.

    Rate this question:

  • 13. 

    Which of the following is a responsibility of a domain layer class? 

    • A.

      a. Display electronic forms and reports.

    • B.

      b. Establish and maintain connections to the database.

    • C.

      c. Capture input events such as clicks, rollovers, and key entry.

    • D.

      d. Process all business rules with appropriate logic.

    Correct Answer
    D. d. Process all business rules with appropriate logic.
    Explanation
    The responsibility of a domain layer class is to process all business rules with appropriate logic. This means that the domain layer class is responsible for implementing the specific rules and logic that govern the behavior and operations of the business domain it represents. This includes enforcing constraints, validating data, and performing any necessary calculations or transformations. The other options listed (displaying electronic forms and reports, establishing and maintaining connections to the database, and capturing input events) are typically responsibilities of other layers or components within an application architecture.

    Rate this question:

  • 14. 

    The singleton pattern has the same basic logic as the ____ method pattern. 

    • A.

      Adapter

    • B.

      Factory

    • C.

      Builder

    • D.

      Observer

    Correct Answer
    B. Factory
    Explanation
    The singleton pattern has the same basic logic as the factory method pattern. Both patterns involve creating objects, but the singleton pattern ensures that only one instance of a class is created and provides a global point of access to it, while the factory method pattern delegates the responsibility of creating objects to subclasses.

    Rate this question:

  • 15. 

    Developing ____ diagrams is at the heart of object-oriented detailed design. 

    • A.

      Method

    • B.

      Interaction

    • C.

      c. design pattern

    • D.

      Artifact

    Correct Answer
    B. Interaction
    Explanation
    In object-oriented detailed design, the development of interaction diagrams is crucial. These diagrams depict how objects interact with each other to accomplish a specific task or functionality. They illustrate the flow of messages and communication between objects, helping to visualize the dynamic behavior of the system. By creating interaction diagrams, designers can effectively plan and organize the interactions between objects, ensuring the smooth functioning of the system.

    Rate this question:

  • 16. 

    A(n) ____ frame is similar to an if-then-else statement or switch statement, which allows the firing of different sets of messages. 

    • A.

      Loop

    • B.

      Rpt

    • C.

      Alt

    • D.

      Opt

    Correct Answer
    C. Alt
    Explanation
    An "Alt" frame is similar to an if-then-else statement or switch statement, which allows the firing of different sets of messages. This means that based on certain conditions, different sets of messages can be executed.

    Rate this question:

  • 17. 

     ____ is the process of elaborating the detailed design with interaction diagrams of a particular use case. 

    • A.

      a. Use case realization

    • B.

      b. Use case control

    • C.

      c. Design patterning

    • D.

      d. Separation of responsibilities

    Correct Answer
    A. a. Use case realization
    Explanation
    Use case realization is the process of elaborating the detailed design with interaction diagrams of a particular use case. This involves identifying the classes, objects, and their interactions that are necessary to implement the use case. It helps in understanding how the use case will be implemented in the system and ensures that the design aligns with the requirements and goals of the use case. Use case realization is an important step in the software development process as it helps in translating the high-level use case into a detailed and implementable design.

    Rate this question:

  • 18. 

    When a message is sent from an originating object to a destination object, in programming terms it means that the originating object is invoking a ____ on the destination object. 

    • A.

      Lifeline

    • B.

      Method

    • C.

      Sequence

    • D.

      Class

    Correct Answer
    B. Method
    Explanation
    When a message is sent from an originating object to a destination object in programming, it means that the originating object is invoking a method on the destination object. A method is a set of instructions or code that defines the behavior of an object. By invoking a method, the originating object is requesting the destination object to perform a specific action or behavior.

    Rate this question:

  • 19. 

    The differences between programming languages and database languages have partially driven the trend to a ____ design. 

    • A.

      Procedural

    • B.

      Schematic

    • C.

      Multilayer

    • D.

      d. single-layer

    Correct Answer
    C. Multilayer
    Explanation
    The differences between programming languages and database languages have partially driven the trend to a multilayer design. This means that the design of systems and applications is becoming more complex and layered, with different programming and database languages being used for different layers. This allows for better separation of concerns and modularity, making it easier to develop and maintain large-scale software systems.

    Rate this question:

  • 20. 

     In OO two-layer designs, the Structured Query Language (SQL) statements to access a database are part of the ____ layer. 

    • A.

      a. business logic

    • B.

      View

    • C.

      Middleware

    • D.

      Separation

    Correct Answer
    A. a. business logic
    Explanation
    In OO two-layer designs, the Structured Query Language (SQL) statements to access a database are part of the business logic layer. The business logic layer is responsible for implementing the business rules and logic of an application. It handles the processing of data and communicates with the data layer, which includes the database. Therefore, the SQL statements used to access the database are included in the business logic layer.

    Rate this question:

Quiz Review Timeline +

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

  • Current Version
  • Nov 16, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Dec 06, 2010
    Quiz Created by
    Nyssa007
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.