What is the difference between the Singleton and Prototype patterns?
- The Singleton pattern allows multiple instances to be created from a single prototype object, while the Prototype pattern ensures that a class has only one instance and provides a global point of access to that instance.
- The Singleton pattern ensures that a class has multiple instances, while the Prototype pattern allows only one instance to be created from a single prototype object.
- The Singleton pattern ensures that a class has only one instance and provides a global point of access to that instance, while the Prototype pattern allows multiple instances to be created from a single prototype object.
- The Singleton pattern ensures that a class has only one instance, while the Prototype pattern ensures that a class has multiple instances with unique characteristics.
The Singleton pattern ensures that a class has only one instance and provides a global point of access to that instance, while the Prototype pattern allows multiple instances to be created from a single prototype object.
What is Data Access Object (DAO) pattern?
- A design pattern to handle communication between objects
- A design pattern to handle the database connections
- A design pattern to manage complex state transitions
- A design pattern to provide a unified interface to a set of interfaces
The DAO pattern provides a unified interface to a set of data sources. It separates the data persistence mechanism from the business logic, allowing the data to be accessed and modified easily and efficiently.
What is the difference between the Factory and Abstract Factory patterns?
- None of the above
- The Factory and Abstract Factory patterns are the same
- The Factory pattern creates objects of a single class, while the Abstract Factory pattern creates objects of several classes
- The Factory pattern creates objects of several classes, while the Abstract Factory pattern creates objects of a single class
The Factory pattern creates objects of a single class, while the Abstract Factory pattern creates objects of several classes
Explain what is Composition over Inheritance?
- Composition over Inheritance is a design principle that eliminates the use of composition for code reuse.
- Composition over Inheritance is a design principle that eliminates the use of inheritance for code reuse.
- Composition over Inheritance is a design principle that favors class inheritance over object composition for code reuse.
- Composition over Inheritance is a design principle that favors object composition over class inheritance for code reuse.
Composition over Inheritance is a design principle that favors object composition over class inheritance for code reuse. It allows for greater flexibility and maintainability in code design.
What is the difference between the Strategy and Template patterns?
- The Strategy pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. The Template pattern defines the skeleton of an algorithm in a method, deferring some steps to subclasses.
- The Strategy pattern defines the skeleton of an algorithm in a method, deferring some steps to subclasses, while the Template pattern defines a family of algorithms and makes them interchangeable.
- The Template pattern is used to allow for loose coupling between the sender of a request and its receivers, while the Strategy pattern provides a unified interface to a set of interfaces in a subsystem.
- The Template pattern is used to convert the interface of a class into another interface clients expect, while the Strategy pattern allows sending requests to objects without knowing anything about the operation being requested or the receiver of the request.
The Strategy pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable, while the Template pattern defines the skeleton of an algorithm in a method, deferring some steps to subclasses.
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.
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.
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.
Which of the following is not a characteristic of SOAP-based web services?
- Lightweight
- Loose coupling
- Platform-independent
- Stateless
SOAP-based web services are not typically considered lightweight; they involve more overhead due to the XML format and additional protocols.
In TLS 1.3, what major security improvement was made compared to its predecessors?
- Elimination of vulnerable cryptographic algorithms and negotiation procedures
- Increased reliance on outdated ciphers for backward compatibility
- Introduction of a complex key exchange mechanism
- Reduction of encryption strength for better performance
TLS 1.3 made a major security improvement by eliminating vulnerable cryptographic algorithms and negotiation procedures, enhancing overall security.
SOAP uses _______ for message format, while REST typically uses formats like _______.
- HTML
- JSON
- XML
- YAML
SOAP (Simple Object Access Protocol) uses XML (eXtensible Markup Language) for message format, whereas REST (Representational State Transfer) typically uses formats like JSON (JavaScript Object Notation) for data interchange due to its simplicity and ease of use in web applications.
_________ is a cryptographic protocol used to secure web communications.
- FTP
- HTTPS
- SNMP
- SSH
HTTPS (Hypertext Transfer Protocol Secure) is a cryptographic protocol used to secure web communications, providing a secure version of HTTP.