Design Patterns

Introduction to Design Pattern

  1. Creational Design Pattern
    1. Singleton Design Pattern
    2. Abstract Factory Pattern
    3. Factory Design Pattern
    4. Enum based Factory Design Pattern
    5. Builder Design Pattern
    6. Prototype Design Pattern
  2. Structural Design Pattern
    1. Adapter Design Pattern
    2. Composite Design Pattern
    3. Facade Design Pattern
    4. Proxy Design Pattern
    5. Bridge Design Pattern
    6. Decorators Design Pattern
    7. Flyweight Design Pattern
  3. Behavioural Design Pattern
    1. Chain of Responsibility Design Pattern
    2. Command Design Pattern
    3. Iterator Design Pattern
    4. Mediator Design Pattern (Single Controller for all communication)
    5. Memento Design Pattern
    6. Observer Design Pattern
    7. State Design Pattern
    8. Strategy Design Pattern
    9. Template Design Pattern
    10. Visitor Design Pattern
  4. Others
    1. Interceptor Design Pattern
    2. Java 8 Design Pattern

Reference :

https://refactoring.guru/design-patterns/creational-patterns

Interview Questions :

  • What are Design Patterns?
    • Design patterns represent the best practices used by experienced object-oriented software developers. Design patterns are solutions to general problems that software developers faced during software development. These solutions were obtained by trial and error by numerous software developers over quite a substantial period of time.
  • What is Gang of Four (GOF)?
    • 4 Authors of Design patterns together wrote a book, the team is called Gang of four
  • Types of Design Patterns ?
  • What is Factory Design Pattern and when to use ?
  • What is Abstract Factory Pattern and when to use ?
  • What is Singleton Design Pattern and when to use ?
  • Name some of the design patterns which are used in JDK library.
    • Following are some of the design patterns which are used in JDK library.Decorator patttern is used by Wrapper classes.
    • Singleton pattern is used by Runtime, Calendar classes.
    • Factory pattern is used by Wrapper class like Integer.valueOf.
    • Observer pattern is used by event handling frameworks like swing, awt.
  • What is Builder Design Pattern and when to use ?
  • What is Prototype Design Pattern and when to use ?
  • What is Adapter Design Pattern and when to use ?
  • What is Bridge pattern and when to use ?
  • What is Filter Design Pattern and when to use ?
  • What is Composite Pattern and when to use ?
  • What is Decorator Design Pattern and when to use ?
  • Facade Pattern
  • Flyweight Pattern
  • Proxy Pattern
  • Chain of Responsibility Pattern
  • Command Pattern
  • Interpreter Pattern
  • Iterator Pattern