Design Patterns - Interview Questions & Answers
1. 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.
2. Mention types of design patterns?
  • Creational Patterns
  • Structural Patterns
  • Behavioral Patterns
3. What are Creational Patterns?
These design patterns provide a way to create objects while hiding the creation logic, rather than instantiating objects directly using new opreator. This gives program more flexibility in deciding which objects need to be created for a given use case.
4. What are Structural Patterns?
These design patterns concern class and object composition. Concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionalities.
5. What are Behavioral Patterns?
These design patterns are specifically concerned with communication between objects.
6. List the patterns that comes under Creational Patterns?
  • Abstract Factory Pattern
  • Singleton Pattern
  • Builder Pattern
  • Factory Pattern
  • Prototype Pattern
7. List the patterns that comes under Structural Patterns?
  • Adapter Pattern
  • Composite Pattern
  • Proxy Pattern
  • Flyweight Pattern
  • Facade Pattern
  • Bridge Pattern
  • Decorator Pattern
8. List the patterns that comes under Behavioral Design Patterns?
  • Template Method Pattern
  • Mediator Pattern
  • Chain of Responsibility Pattern
  • Observer Pattern
  • Strategy Pattern
  • Command Pattern
  • State Pattern
  • Visitor Pattern
  • Iterator Pattern
  • Memento Pattern
Questions & Answers