What is the Chain of Responsibility pattern?

  • The Chain of Responsibility pattern is a design pattern that allows multiple objects to handle a request one by one, until one of them handles it successfully.
  • The Chain of Responsibility pattern is a design pattern that allows objects to be chained together, so that when a request is made, it can be passed from one object to the next, until it is handled.
  • The Chain of Responsibility pattern is a design pattern that allows objects to be linked together, so that a request can be passed from one object to another, until it is handled.
  • The Chain of Responsibility pattern is a design pattern that uses a set of objects to handle a request, without specifying the receiver.
The Chain of Responsibility pattern is a behavioral design pattern that involves passing a request sequentially through a dynamic list of objects until one of them handles it. The objects become a chain of receivers, and the request is sent from one object to another, until it is handled. This allows for a greater level of decoupling between the objects, making it easier to modify or extend the system.

What is Builder pattern?

  • A design pattern that allows the creation of objects without specifying the exact class of object that will be created
  • A design pattern that helps to create objects in a step-by-step manner, allowing for more control over the object creation process
  • A design pattern that helps to reduce the number of objects in the system, making it more efficient
  • A design pattern that promotes the loose coupling between objects, making the system easier to maintain and extend
Builder pattern is a design pattern that helps to create objects in a step-by-step manner, allowing for more control over the object creation process. This pattern separates the construction of a complex object from its representation, allowing for the same construction process to create different representations.

What is the MVC pattern?

  • A behavioral design pattern that lets you pass requests along a dynamic chain of receivers until one of them handles it.
  • A creational design pattern that uses factory methods to deal with the problem of creating objects without specifying the exact class of object that will be created.
  • A software architecture pattern that separates the representation of information from the user's interaction with it. The pattern defines three main components: the Model, the View, and the Controller.
  • A structural design pattern that allows you to compose objects into tree structures to represent part-whole hierarchies.
A software architecture pattern that separates the representation of information from the user's interaction with it. The pattern defines three main components: the Model, the View, and the Controller.

What is the purpose of the Memento pattern?

  • To create complex objects step by step, using a builder object to abstract the process of creating the object
  • To provide a common interface for a group of related classes
  • To provide a mechanism for saving and restoring an object's internal state without violating encapsulation
  • To provide a simplified interface to a complex system, hiding the complexity of the system behind a single interface
The Memento pattern provides a mechanism for saving and restoring an object's internal state without violating encapsulation

Explain difference between the Facade, Proxy, Adapter and Decorator design patterns?

  • The Facade design pattern provides a simplified interface to a complex system, while the Proxy design pattern provides a placeholder for another object to control access to it. The Adapter design pattern converts the interface of a class into another interface that the client expects, and the Decorator design pattern adds behavior to an individual object, dynamically, without affecting the behavior of other objects from the same class.
  • The Facade design pattern provides a unified interface to a set of interfaces in a system, while the Proxy design pattern provides a way to access an object indirectly. The Adapter design pattern adapts an object to a new interface, and the Decorator design pattern adds behavior to an individual object, dynamically, but affects the behavior of other objects from the same class.
  • The Facade design pattern provides a way to access a system's functionality, while the Proxy design pattern provides a way to extend an object's functionality. The Adapter design pattern converts the interface of one class into that of another, and the Decorator design pattern adds behavior to an individual object, statically, and affects the behavior of other objects from the same class.
  • The Facade design pattern provides an intermediary between two systems, while the Proxy design pattern provides a default implementation of an interface. The Adapter design pattern is used to allow two systems to work together, and the Decorator design pattern adds behavior to an object, statically, without affecting the behavior of other objects from the same class.
The Facade design pattern provides a simplified interface to a complex system, while the Proxy design pattern provides a placeholder for another object to control access to it. The Adapter design pattern converts the interface of a class into another interface that the client expects, and the Decorator design pattern adds behavior to an individual object, dynamically, without affecting the behavior of other objects from the same class.

What is a pattern?

  • A recurring solution to a common problem in a specific context. Patterns can be used in many different fields, including software development, architecture, and design.
  • A sequence of actions or behaviors that are repeated in a particular situation.
  • A set of coding conventions that must be followed when developing software to ensure consistency and readability.
  • A specific arrangement or design that is repeated in a work of art or architecture.
A pattern is a general, reusable solution to a commonly occurring problem in a specific context. In software development, patterns are often used to solve design problems and improve the quality and maintainability of code.

What is the Observer design pattern used for?

  • To define a one-to-many dependency between objects so that changes to one object result in changes to many other objects.
  • To encapsulate operations in an object and pass them as messages.
  • To ensure that a class has only one instance and provide a global point of access to that instance.
  • To provide a way to dynamically instantiate objects of a specified class.
The Observer design pattern is used to define a one-to-many dependency between objects so that changes to one object result in changes to many other objects. This can be useful in situations where it is important to keep multiple objects in sync with each other.

How should I be grouping my Repositories when using Repository Pattern?

  • Repositories should be grouped based on the database tables they access, for example grouping all repositories that access a specific table in a single class or namespace.
  • Repositories should be grouped based on the domain entities they provide access to, for example grouping all repositories for a specific type of entity in a single class or namespace.
  • Repositories should be grouped based on the type of operations they support, for example grouping all repositories that support read operations in a single class or namespace.
  • Repositories should be grouped based on their implementation, for example grouping all repositories that use a specific data access technology in a single class or namespace.
Repositories should be grouped based on the domain entities they provide access to, as this provides a clear and organized way of grouping related repositories.

What is the purpose of the Business Delegate pattern?

  • To create objects with complex behavior.
  • To define a default behavior for an object.
  • To encapsulate business logic and provide a clean API for clients.
  • To manage the lifecycle of objects.
The Business Delegate pattern aims to encapsulate complex business logic and provide a clean API for clients to access it, reducing coupling between the client and business logic.

Name the actor classes used in Observer pattern.

  • ConcreteObserver, Subject, Observer
  • Observer, ConcreteObserver, Subject
  • Subject, Observer, ConcreteObserver
  • Subject, Observer, ConcreteSubject
The actor classes used in the Observer pattern are: Subject, Observer, and ConcreteObserver. The Subject class is responsible for maintaining a list of its dependents and notifying them of changes to its state. The Observer class is an abstract class that defines the interface for updating dependents. The ConcreteObserver class is a concrete implementation of the Observer class, responsible for updating its state in response to changes to the subject's state.