Design Patterns Interview questions - International Days

International Days

Internationally important Days

Breaking

Home Top Ad

Post Top Ad

Tuesday, 31 October 2017

Design Patterns Interview questions

Design Patterns Interview questions
  Design patterns are more related to the design level approach to a problem than coding level . Design pattern interview questions frequently asked in more experienced level of interviews. I have listed out most of them below please add as comment missed out questions.

Q) What are Design Patterns ? (Design patterns interview questions -1)

Design patterns are more general solution for a frequently occurring problem with in a software design . Design patterns are time tested practices for Object Oriented Programming .It help people to think Object Oriented aspect of thinking .

Q) What are the main types of design patterns ? (Design Patterns interview questions -2)

It mainly classifieds as three categories Creationals , structural and Behavioral patterns

Creational Patterns : It deals with the object creational mechanisms. It used in situations like its basic form of object creation increases the complexity of code base. It is mainly deals with the way of creating objects. The types of creational patterns are
  • Abstract factory patterns
  • Builder patterns
  • Factory method patterns
  • Prototype patterns
  • Singleton patterns
Structural Patterns : The structural patterns are design patterns that ease the design by identifying the exact relationship with entities. In other words, it deals with how the objects and classes can be composed ,to form larger structures. The types of structural patterns are
  • Adapter patterns
  • Bridge patterns
  • Composite patterns
  • Decorator patterns
  • Facade patterns
  • Flyweight patterns
  • Proxy patterns
Behavioral Patterns : It is concerned with assignment of responsibilities between objects. It describes how the objects interact . It explains how the objects and classed interact to make things happens and how its tasks are divided to them.
  • Chain of responsibility pattern
  • Command pattern
  • Interpreter pattern
  • Iterator pattern
  • Mediator pattern
  • Memento pattern
  • Observer pattern
  • State pattern
  • Strategy pattern
  • Template pattern
  • Visitor pattern
Q)What are factory patterns in Design patterns ? (Design patterns interview question -3)

Factory pattern is included among most used design patterns . It falls under creational design patterns. We create object without exposing creational logic . We use interface to create object and let the subclass really describes which class to instantiate .

Q)What is Abstract factory pattern ?(Design patterns interview question -4)

Abstract factory patterns acts as a super factory which create another factories.This is also known as factory of factory classes. In this interface is responsible for creating a set of related objects .  


Q) What is a singleton Class ? (Design patterns interview question -5)
       
  Singleton pattern is the simplest form of design pattern . It comes under the creational design pattern. It is used where we need to create only one instance of a class and provides global point of access to it. Weather it may be DB connection or other project constant etc. The idea is this class should be instantiated only once .


Q)What is Facade Pattern (Design pattern interview question -6)


  Facade patterns comes under Structural Pattern . It uses when the system is very complex to implement .when it has number of independent classes or source code of some dll is not available. Facade patterns mask the complexity and create an interface which is easy to implement . This contains a single wrapper class which contains only the necessary set of members .  





No comments:

Post a Comment

Post Bottom Ad

Pages