Design Patterns - Interview Questions

Abstract Factory


What is Abstract Factory Design Pattern?

key Concept

The GoF design patterns book defines Abstract factory design pattern as follows - 'provide an interface for creating families of related or dependent objects without specifying their concrete classes.'


Factory


What is Factory Design Pattern?

FAQkey Concept

The GoF design patterns book defines Factory design pattern as follows - 'Define an interface for creating an object, but let sub-classes decide which class to instantiate. Factory method lets a class defer instantiation to sub-classes.'


Builder


What is Builder Design Pattern?

key Concept

The GoF design patterns book defines Builder design pattern as follows - 'Separate the construction of a complex object from its representation so that the same construction process can create different representations.'


Prototype


What is Prototype Design Pattern?

key Concept

The GoF design patterns book defines Prototype design pattern as follows - 'Specify the kind of objects to create using a prototypical instance, and create new objects by copying this prototype.'


Singleton


What is Singleton Design Pattern?

FAQkey Concept

The GoF design patterns book defines Singleton design pattern as follows - 'Ensure a class only has one instance, and provide a global point of access to it.'


What is Flyweight Design Pattern?

FAQkey Concept

The GoF design patterns book defines Flyweight design pattern as follows - 'Use sharing to support large number of fine-grained objects efficiently.'


What is Chain Of Responsibility Design Pattern?

FAQkey Concept

The GoF design patterns book defines Chain Of Responsibility design pattern as follows - 'Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.'


Adapter


What is Adapter Design Pattern?

FAQkey Concept

The GoF design patterns book defines Adapter design pattern as follows - 'Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.


What is Asynchronism?

key Concept

Asynchronism refers to Asynchronius workflow architectures which help reduce request times for expensive operations that would otherwise be performed in-line.


What do you mean by availability of a system?

FAQkey Concept

Availability of a system means that a request to the system receives a response back from the system without failure. Availability is usually measured by the percentage of successful requests over a period of time.


What do you mean by availability of a system?

FAQkey Concept

Availability of a system means that a request to the system receives a response back from the system without failure. Availability is usually measured by the percentage of successful requests over a period of time.


What do you mean by availability of a system?

FAQkey Concept

Availability of a system means that a request to the system receives a response back from the system without failure. Availability is usually measured by the percentage of successful requests over a period of time.


Bridge


What is Bridge Design Pattern?

FAQkey Concept

The GoF design patterns book defines Bridge design pattern as follows - 'Decouple an abstraction from its implementation so that the two can vary independently.'


Composite


What is Composite Design Pattern?

FAQkey Concept

The GoF design patterns book defines Composite design pattern as follows - 'Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.'


Decorator


What is Decorator Design Pattern?

FAQkey Concept

The GoF design patterns book defines Decorator design pattern as follows - 'Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to sub-classing for extending functionality.'


Facade


What is Facade Design Pattern?

FAQkey Concept

The GoF design patterns book defines Facade design pattern as follows - 'Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.'


Flyweight


Proxy


What is Proxy Design Pattern?

FAQkey Concept

The GoF design patterns book defines Proxy design pattern as follows - 'Provide a surrogate or a placeholder for another object to control access to it.'


Chain Of Responsibility


Command


What is Command Design Pattern?

FAQkey Concept

The GoF design patterns book defines Command design pattern as follows - 'Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.'


Interpreter


What is Interpreter Design Pattern?

FAQkey Concept

The GoF design patterns book defines Interpreter design pattern as follows - 'Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.'


Iterator


What is Iterator Design Pattern?

FAQkey Concept

The GoF design patterns book defines Iterator design pattern as follows - 'Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation'


Mediator


What is Mediator Design Pattern?

FAQkey Concept

The GoF design patterns book defines Mediator design pattern as follows - 'Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently.'


Memento


What is Memento Design Pattern?

FAQkey Concept

The GoF design patterns book defines Memento design pattern as follows - 'Without violating encapsulation, capture and externalize an object's internal state so that the object can be restored to this state later.'


Observer


What is Observer Design Pattern?

FAQkey Concept

The GoF design patterns book defines Observer design pattern as follows - 'Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.'


State


What is State Design Pattern?

FAQkey Concept

The GoF design patterns book defines State design pattern as follows - 'Allow an object to alter its behaviour when its internal state changes. The object will appear to change its class.'


strategy


What is Strategy Design Pattern?

FAQkey Concept

The GoF design patterns book defines Strategy design pattern as follows - 'Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.'


Template


What is Template Design Pattern?

FAQkey Concept

The GoF design patterns book defines Template design pattern as follows - 'Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.'


Visitor


What is Visitor Design Pattern?

FAQkey Concept

The GoF design patterns book defines Visitor design pattern as follows - 'Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the class of the elements on which it operates.'


 
Subscribe to our Newsletter

 
 
RECOMMENDED RESOURCES
Behaviorial Interview
Top resource to prepare for behaviorial and situational interview questions.

STAR Interview Example