- Interfaces
ADAPTER, FACADE, COMPOSITE, BRIDGE
- Responsibility
SINGLETON, OBSERVER, MEDIATOR, PROXY, CHAIN OF RESPONSIBILITY, FLYWEIGHT
- Construction
BUILDER, FACTORY METHOD, ABSTRACT FACTORY,PROTOTYPE, MEMENTO
- Operations
TEMPLATE METHOD, STATE, STRATEGY, COMMAND,INTERPRETER
- Extensions
DECORATOR, ITERATOR, VISITOR
Types of design patterns according to their purposes:
- – Creational: creating, initializing and configuring classes and objects
- – Structural patterns: composition of classes and objects
- – Behavioral patterns: dynamic interactions among classes and objects
- Classification and list
- Creational patterns
- Structural patterns
- Behavioral patterns
- Concurrency patterns
- What are the categories design patterns divided into?
Creational Pattern:Creational patterns provide ways to instantiate single objects or group of related objects.
Structural Patterns:Structural patterns provide a way to define relationship between classes and objects.
Behavioral Patterns:Behavioral patterns define ways of communication between classes and objects.
Can you give name of patterns fall in each category?
Ans. Five patterns fall under creational pattern.
Abstract Factory
Factory
Factory Method
Prototype
Singleton
Seven patterns fall under structural pattern.
Adapter
Bridge
Composite
Decorator
Façade
Flyweight
Proxy
Eleven patterns fall under behavioral pattern.
Chain of Responsibility
Command
Interpreter
Iterator
Mediator
Memento
Observer
State
Strategy
Template Method
Visitor
What are object patterns?
Ans. Object patterns deals with object relationships that can be changed at runtime.
Object patterns mostly use object composition to establish relationships between objects.
What are class patterns?
Ans. Class patterns deals with class relationships that can be changed at compile time
class patterns tend to use inheritance to establish relationships.
Can you list down different class patterns and object patterns?
Ans.
Class Patterns
Adapter
Factory Method
Interpreter
Template Method
Object Patterns
Abstract Factory
Builder
Bridge
Chain of Responsibility
Command
Composition
Decorator
Façade
Flyweight
Iterator
Mediator
Memento
Observer
Prototype
Proxy
Singleton
State
Strategy
Visitor
http://jinaldesai.net/basic-design-patterns-interview-questions/
No comments:
Post a Comment