SlideShare uma empresa Scribd logo
1 de 4
Articles from Jinal Desai .NET
Basic Design Patterns Interview Questions
2013-06-01 05:06:51 Jinal Desai
1. What is Design Patterns?
Ans. Design patterns are time tested reusable design solutions to recurring
problems in application development.
2. What is Gang of Four in design patterns?
Ans. The Gang of Four are the four authors of the book, “Design Patterns: Elements
of Reusable Object-Oriented Software”. The four authors were Erich Gamma,
Richard Helm, Ralph Johnson and John Vlissides. The Gand of Four(GoF)
terminology refers to the book or either author in design pattern. GoF patterns are
generally considered foundation for all other patterns.
3. How many total patterns are there in GoF?
Ans. There are total 23 patterns in GoF.
4. What are the categories design patterns divided into?
Ans. There are total three categories into which design patterns divided.
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.
5. 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
6. What are object patterns?
Ans. Object patterns deals with object relationships that can be changed at runtime.
It specify the relationships between objects. The purpose of object pattern is to allow
the instances of different classes to be used in the same place in a pattern.
Object patterns avoid fixing the class that accomplishes a given task at compile
time.
Instead the actual class of the object can be chosen at runtime. Object patterns
mostly use object composition to establish relationships between objects.
7. What are class patterns?
Ans. Class patterns deals with class relationships that can be changed at compile
time. It specify relationship between classes and their subclasses.
Thus, class patterns tend to use inheritance to establish relationships.
Unlike object patterns and object relationships, class patterns generally fix the
relationship at compile time.
They are less flexible and dynamic and less suited to polymorphic approaches.
8. What is class scope in class patterns?
Ans. Class scope in class patterns is defined at design(compile) time. Class scope
is built in the structure and relationship of classes.
9. What is object scope in object patterns?
Ans. Object scope in object patterns is defined at runtime. Object scope is based
on the relationship of objects(mostly object composition).
10. 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
Following is reference table for distribution of design patterns into Class or Object
Patterns and categories of patterns(Creational, Structural and Behavioral).
Purpose
Creational Structural Behavioral
Scope
Class Factory Method Adapter
Interpreter
Template Method
Object
Abstract Factory
Builder
Prototype
Singleton
Bridge
Composite
Decorator
Facade
Flyweight
Proxy
Chain of Responsibility
Command
Iterator
Mediator
Memento
Flyweight
Observer
State
Strategy
Visitor
11. Can you describe all five creational patterns in one line? (Interviewer will
not ask for all five, only one or two)
Ans.
Abstract Factory pattern is used to provide a client with set of “family” of objects
created by the factory which is determined at runtime.
Builder pattern is used to create complex objects with internal parts that must be
created in the same order or using a specific algorithm.
Factory Method pattern is used to replace class constructors, abstracting the
process of object generation in a way that the type of object instantiated can be
determined at runtime.
Prototype pattern is used to instantiate new object by copying all of the properties
of an existing object, creating an independent clone.
Singleton pattern ensures single object of a particular class.
12. Can you describe all seven structural patterns in one line? (Interviewer
will not ask for all seven, only one or two)
Ans.
Adapter pattern is used to provide mechanism to link two incompatible types by
wrapping the “adaptee” with a class that supports the interface required by the
client.
Bridge pattern is used to separate the abstract element of a class from the
implementation details, providing the means to replace the implementation details
without modifying the abstraction.
Composite pattern is used to create hierarchical, recursive tree structures of
related objects where any element of the structure may be accessed and utilized in
a standard manner.
Decorator pattern is used to extend or alter the functionality of objects at run-time
by wrapping them in an object of a decorator class.
Façade pattern is used to define a simplified interface to a more complex
subsystem.
Flyweight pattern is used to reduce the memory and resource usage for complex
models containing many hundreds, thousands or hundreds of thousands of similar
objects.
Proxy pattern is used to provide a placeholder object, which references an
underlying object.
13. Can you describe all eleven behavioral patterns in one line? (Interviewer
will not ask for all eleven, only one or two)
Ans.
Chain of Responsibility pattern is used to process varied requests, each of which
may be dealt with by a different handler.
Command pattern is used to express a request, including the call to be made and
all of its required parameters, in a command object.
Interpreter pattern is used to define the grammar for instructions that form part of a
language or notation, whilst allowing the grammar to be easily extended.
Iterator pattern is used to provide a standard interface for traversing a collection of
items in an aggregate object without the need to understand its underlying structure.
Mediator pattern is used to reduce coupling between classes that communicate
with each other by sending messages via a mediator object.
Memento pattern is used to capture the current state of an object and store it in
such a manner that it can be restored at a later time without breaking the rules of
encapsulation.
Observer pattern is used to allow an object to publish changes to its state. Other
objects subscribe to be immediately notified of any changes.
State pattern is used to alter the behavior of an object at runtime as its internal state
changes.
Strategy pattern is used to create an interchangeable family of algorithms from
which the required process is chosen at run-time.
Template Method pattern is used to define the basic steps of an algorithm and
allow the implementation of the individual steps to be changed.
Visitor pattern is used to separate a relatively complex set of structured data
classes from the functionality that may be performed upon the data that they hold.

Mais conteúdo relacionado

Mais procurados (20)

Spring Core
Spring CoreSpring Core
Spring Core
 
Iterator
IteratorIterator
Iterator
 
Observer Software Design Pattern
Observer Software Design Pattern Observer Software Design Pattern
Observer Software Design Pattern
 
Struts framework
Struts frameworkStruts framework
Struts framework
 
IBM_Q-Rep-Tutorial
IBM_Q-Rep-TutorialIBM_Q-Rep-Tutorial
IBM_Q-Rep-Tutorial
 
Gof design patterns
Gof design patternsGof design patterns
Gof design patterns
 
Model view controller (mvc)
Model view controller (mvc)Model view controller (mvc)
Model view controller (mvc)
 
Spring data jpa
Spring data jpaSpring data jpa
Spring data jpa
 
Spring & hibernate
Spring & hibernateSpring & hibernate
Spring & hibernate
 
Java Course 11: Design Patterns
Java Course 11: Design PatternsJava Course 11: Design Patterns
Java Course 11: Design Patterns
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introduction
 
MVC Framework
MVC FrameworkMVC Framework
MVC Framework
 
Unit 07: Design Patterns and Frameworks (1/3)
Unit 07: Design Patterns and Frameworks (1/3)Unit 07: Design Patterns and Frameworks (1/3)
Unit 07: Design Patterns and Frameworks (1/3)
 
Chain of responsibility
Chain of responsibilityChain of responsibility
Chain of responsibility
 
Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Proxy Design Pattern
Proxy Design PatternProxy Design Pattern
Proxy Design Pattern
 
Chain of Responsibility Pattern
Chain of Responsibility PatternChain of Responsibility Pattern
Chain of Responsibility Pattern
 
Command Design Pattern
Command Design PatternCommand Design Pattern
Command Design Pattern
 
Understanding LINQ in C#
Understanding LINQ in C# Understanding LINQ in C#
Understanding LINQ in C#
 

Destaque

29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview QuestionsArc & Codementor
 
Job evaluation process - compensation management - Manu Melwin Joy
Job evaluation process -  compensation management - Manu Melwin JoyJob evaluation process -  compensation management - Manu Melwin Joy
Job evaluation process - compensation management - Manu Melwin Joymanumelwin
 
Top 9 design pattern interview questions answers
Top 9 design pattern interview questions answersTop 9 design pattern interview questions answers
Top 9 design pattern interview questions answershudsons168
 
Let's investigate
Let's investigateLet's investigate
Let's investigateESO1
 
A Biblioteca FEA em números - 2015
A Biblioteca FEA em números - 2015A Biblioteca FEA em números - 2015
A Biblioteca FEA em números - 2015Biblioteca FEAUSP
 
まわりをまきこむ
まわりをまきこむまわりをまきこむ
まわりをまきこむkomeshogu n
 
Sensory Needs, Autism and Expectations
Sensory Needs, Autism and ExpectationsSensory Needs, Autism and Expectations
Sensory Needs, Autism and ExpectationsColleen Nagle Tryner
 
Carlos Ruiz Zafón
Carlos Ruiz Zafón Carlos Ruiz Zafón
Carlos Ruiz Zafón ESO1
 
Presentación 5
Presentación 5Presentación 5
Presentación 5ESO1
 
COSPE 2012 - Gender equality palestine_EN
COSPE 2012 - Gender equality palestine_ENCOSPE 2012 - Gender equality palestine_EN
COSPE 2012 - Gender equality palestine_ENMassimo Alone
 
TolunaTopics: Entrepreneurship in France and US
TolunaTopics: Entrepreneurship in France and USTolunaTopics: Entrepreneurship in France and US
TolunaTopics: Entrepreneurship in France and USToluna
 
Soa design pattern
Soa design patternSoa design pattern
Soa design patternLap Doan
 
リピートオーダーを増やすデジタルコミュニケーション戦略
リピートオーダーを増やすデジタルコミュニケーション戦略リピートオーダーを増やすデジタルコミュニケーション戦略
リピートオーダーを増やすデジタルコミュニケーション戦略株式会社ヴィクシア
 
UEDA Annual Summit 2016: The Center for Research in SEAD Education - "Moving ...
UEDA Annual Summit 2016: The Center for Research in SEAD Education - "Moving ...UEDA Annual Summit 2016: The Center for Research in SEAD Education - "Moving ...
UEDA Annual Summit 2016: The Center for Research in SEAD Education - "Moving ...University Economic Development Association
 
Java Design Pattern Interview Questions
Java Design Pattern Interview QuestionsJava Design Pattern Interview Questions
Java Design Pattern Interview Questionsjbashask
 

Destaque (20)

29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions
 
Job evaluation process - compensation management - Manu Melwin Joy
Job evaluation process -  compensation management - Manu Melwin JoyJob evaluation process -  compensation management - Manu Melwin Joy
Job evaluation process - compensation management - Manu Melwin Joy
 
Top 9 design pattern interview questions answers
Top 9 design pattern interview questions answersTop 9 design pattern interview questions answers
Top 9 design pattern interview questions answers
 
Let's investigate
Let's investigateLet's investigate
Let's investigate
 
A Biblioteca FEA em números - 2015
A Biblioteca FEA em números - 2015A Biblioteca FEA em números - 2015
A Biblioteca FEA em números - 2015
 
まわりをまきこむ
まわりをまきこむまわりをまきこむ
まわりをまきこむ
 
Sensory Needs, Autism and Expectations
Sensory Needs, Autism and ExpectationsSensory Needs, Autism and Expectations
Sensory Needs, Autism and Expectations
 
The Indian Entrepreneur
The Indian Entrepreneur The Indian Entrepreneur
The Indian Entrepreneur
 
Carlos Ruiz Zafón
Carlos Ruiz Zafón Carlos Ruiz Zafón
Carlos Ruiz Zafón
 
Presentación 5
Presentación 5Presentación 5
Presentación 5
 
COSPE 2012 - Gender equality palestine_EN
COSPE 2012 - Gender equality palestine_ENCOSPE 2012 - Gender equality palestine_EN
COSPE 2012 - Gender equality palestine_EN
 
f/21 Quarterly Q4|2015
f/21 Quarterly Q4|2015f/21 Quarterly Q4|2015
f/21 Quarterly Q4|2015
 
Cyberbullying
CyberbullyingCyberbullying
Cyberbullying
 
TolunaTopics: Entrepreneurship in France and US
TolunaTopics: Entrepreneurship in France and USTolunaTopics: Entrepreneurship in France and US
TolunaTopics: Entrepreneurship in France and US
 
Soa design pattern
Soa design patternSoa design pattern
Soa design pattern
 
リピートオーダーを増やすデジタルコミュニケーション戦略
リピートオーダーを増やすデジタルコミュニケーション戦略リピートオーダーを増やすデジタルコミュニケーション戦略
リピートオーダーを増やすデジタルコミュニケーション戦略
 
IAB Presentation
IAB PresentationIAB Presentation
IAB Presentation
 
Madonna
MadonnaMadonna
Madonna
 
UEDA Annual Summit 2016: The Center for Research in SEAD Education - "Moving ...
UEDA Annual Summit 2016: The Center for Research in SEAD Education - "Moving ...UEDA Annual Summit 2016: The Center for Research in SEAD Education - "Moving ...
UEDA Annual Summit 2016: The Center for Research in SEAD Education - "Moving ...
 
Java Design Pattern Interview Questions
Java Design Pattern Interview QuestionsJava Design Pattern Interview Questions
Java Design Pattern Interview Questions
 

Semelhante a Basic design pattern interview questions

Software Design Patterns - An Overview
Software Design Patterns - An OverviewSoftware Design Patterns - An Overview
Software Design Patterns - An OverviewFarwa Ansari
 
Design pattern 1
Design pattern 1Design pattern 1
Design pattern 1Naga Muruga
 
Software design and Architecture.pptx
Software design and Architecture.pptxSoftware design and Architecture.pptx
Software design and Architecture.pptxSHAHZAIBABBAS13
 
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...Anil Sharma
 
Top 30 Technical interview questions
Top 30 Technical interview questionsTop 30 Technical interview questions
Top 30 Technical interview questionsSohailSaifi15
 
Unit No 6 Design Patterns.pptx
Unit No 6 Design Patterns.pptxUnit No 6 Design Patterns.pptx
Unit No 6 Design Patterns.pptxDrYogeshDeshmukh1
 
Design Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur UniversityDesign Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur UniversityShubham Narkhede
 
UML Design Class Diagrams (2014)
UML Design Class Diagrams (2014)UML Design Class Diagrams (2014)
UML Design Class Diagrams (2014)Miriam Ruiz
 
Bartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design PatternsBartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design PatternsJason Townsend, MBA
 
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...Luis Valencia
 
Object-Oriented Analysis and Design
Object-Oriented Analysis and DesignObject-Oriented Analysis and Design
Object-Oriented Analysis and DesignIJOAEM
 
ap assignmnet presentation.pptx
ap assignmnet presentation.pptxap assignmnet presentation.pptx
ap assignmnet presentation.pptxAwanAdhikari
 
Review oop and ood
Review oop and oodReview oop and ood
Review oop and oodthan sare
 
Behavioral pattern By:-Priyanka Pradhan
Behavioral pattern By:-Priyanka PradhanBehavioral pattern By:-Priyanka Pradhan
Behavioral pattern By:-Priyanka PradhanPriyanka Pradhan
 
Design Pattern in Software Engineering
Design Pattern in Software Engineering Design Pattern in Software Engineering
Design Pattern in Software Engineering Bilal Hassan
 

Semelhante a Basic design pattern interview questions (20)

Design patterns
Design patternsDesign patterns
Design patterns
 
Software Design Patterns - An Overview
Software Design Patterns - An OverviewSoftware Design Patterns - An Overview
Software Design Patterns - An Overview
 
Design pattern 1
Design pattern 1Design pattern 1
Design pattern 1
 
Software design and Architecture.pptx
Software design and Architecture.pptxSoftware design and Architecture.pptx
Software design and Architecture.pptx
 
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
 
Top 30 Technical interview questions
Top 30 Technical interview questionsTop 30 Technical interview questions
Top 30 Technical interview questions
 
OOP design patterns
OOP design patternsOOP design patterns
OOP design patterns
 
Unit No 6 Design Patterns.pptx
Unit No 6 Design Patterns.pptxUnit No 6 Design Patterns.pptx
Unit No 6 Design Patterns.pptx
 
Design Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur UniversityDesign Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur University
 
UML Design Class Diagrams (2014)
UML Design Class Diagrams (2014)UML Design Class Diagrams (2014)
UML Design Class Diagrams (2014)
 
Bartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design PatternsBartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design Patterns
 
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Object-Oriented Analysis and Design
Object-Oriented Analysis and DesignObject-Oriented Analysis and Design
Object-Oriented Analysis and Design
 
ap assignmnet presentation.pptx
ap assignmnet presentation.pptxap assignmnet presentation.pptx
ap assignmnet presentation.pptx
 
Review oop and ood
Review oop and oodReview oop and ood
Review oop and ood
 
Oops design pattern_amitgupta
Oops design pattern_amitguptaOops design pattern_amitgupta
Oops design pattern_amitgupta
 
Behavioral pattern By:-Priyanka Pradhan
Behavioral pattern By:-Priyanka PradhanBehavioral pattern By:-Priyanka Pradhan
Behavioral pattern By:-Priyanka Pradhan
 
Design Pattern in Software Engineering
Design Pattern in Software Engineering Design Pattern in Software Engineering
Design Pattern in Software Engineering
 

Mais de jinaldesailive

State Management In ASP.NET And ASP.NET MVC
State Management In ASP.NET And ASP.NET MVCState Management In ASP.NET And ASP.NET MVC
State Management In ASP.NET And ASP.NET MVCjinaldesailive
 
Exam 70 480 CSS3 at Jinal Desai .NET
Exam 70 480 CSS3 at Jinal Desai .NETExam 70 480 CSS3 at Jinal Desai .NET
Exam 70 480 CSS3 at Jinal Desai .NETjinaldesailive
 
OOPS With CSharp - Jinal Desai .NET
OOPS With CSharp - Jinal Desai .NETOOPS With CSharp - Jinal Desai .NET
OOPS With CSharp - Jinal Desai .NETjinaldesailive
 
Mvc interview questions – deep dive jinal desai
Mvc interview questions – deep dive   jinal desaiMvc interview questions – deep dive   jinal desai
Mvc interview questions – deep dive jinal desaijinaldesailive
 
Software design principles - jinal desai
Software design principles - jinal desaiSoftware design principles - jinal desai
Software design principles - jinal desaijinaldesailive
 

Mais de jinaldesailive (6)

Wcf tutorials
Wcf tutorialsWcf tutorials
Wcf tutorials
 
State Management In ASP.NET And ASP.NET MVC
State Management In ASP.NET And ASP.NET MVCState Management In ASP.NET And ASP.NET MVC
State Management In ASP.NET And ASP.NET MVC
 
Exam 70 480 CSS3 at Jinal Desai .NET
Exam 70 480 CSS3 at Jinal Desai .NETExam 70 480 CSS3 at Jinal Desai .NET
Exam 70 480 CSS3 at Jinal Desai .NET
 
OOPS With CSharp - Jinal Desai .NET
OOPS With CSharp - Jinal Desai .NETOOPS With CSharp - Jinal Desai .NET
OOPS With CSharp - Jinal Desai .NET
 
Mvc interview questions – deep dive jinal desai
Mvc interview questions – deep dive   jinal desaiMvc interview questions – deep dive   jinal desai
Mvc interview questions – deep dive jinal desai
 
Software design principles - jinal desai
Software design principles - jinal desaiSoftware design principles - jinal desai
Software design principles - jinal desai
 

Último

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Último (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Basic design pattern interview questions

  • 1. Articles from Jinal Desai .NET Basic Design Patterns Interview Questions 2013-06-01 05:06:51 Jinal Desai 1. What is Design Patterns? Ans. Design patterns are time tested reusable design solutions to recurring problems in application development. 2. What is Gang of Four in design patterns? Ans. The Gang of Four are the four authors of the book, “Design Patterns: Elements of Reusable Object-Oriented Software”. The four authors were Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides. The Gand of Four(GoF) terminology refers to the book or either author in design pattern. GoF patterns are generally considered foundation for all other patterns. 3. How many total patterns are there in GoF? Ans. There are total 23 patterns in GoF. 4. What are the categories design patterns divided into? Ans. There are total three categories into which design patterns divided. 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. 5. 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
  • 2. Iterator Mediator Memento Observer State Strategy Template Method Visitor 6. What are object patterns? Ans. Object patterns deals with object relationships that can be changed at runtime. It specify the relationships between objects. The purpose of object pattern is to allow the instances of different classes to be used in the same place in a pattern. Object patterns avoid fixing the class that accomplishes a given task at compile time. Instead the actual class of the object can be chosen at runtime. Object patterns mostly use object composition to establish relationships between objects. 7. What are class patterns? Ans. Class patterns deals with class relationships that can be changed at compile time. It specify relationship between classes and their subclasses. Thus, class patterns tend to use inheritance to establish relationships. Unlike object patterns and object relationships, class patterns generally fix the relationship at compile time. They are less flexible and dynamic and less suited to polymorphic approaches. 8. What is class scope in class patterns? Ans. Class scope in class patterns is defined at design(compile) time. Class scope is built in the structure and relationship of classes. 9. What is object scope in object patterns? Ans. Object scope in object patterns is defined at runtime. Object scope is based on the relationship of objects(mostly object composition). 10. 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
  • 3. Façade Flyweight Iterator Mediator Memento Observer Prototype Proxy Singleton State Strategy Visitor Following is reference table for distribution of design patterns into Class or Object Patterns and categories of patterns(Creational, Structural and Behavioral). Purpose Creational Structural Behavioral Scope Class Factory Method Adapter Interpreter Template Method Object Abstract Factory Builder Prototype Singleton Bridge Composite Decorator Facade Flyweight Proxy Chain of Responsibility Command Iterator Mediator Memento Flyweight Observer State Strategy Visitor 11. Can you describe all five creational patterns in one line? (Interviewer will not ask for all five, only one or two) Ans. Abstract Factory pattern is used to provide a client with set of “family” of objects created by the factory which is determined at runtime. Builder pattern is used to create complex objects with internal parts that must be created in the same order or using a specific algorithm. Factory Method pattern is used to replace class constructors, abstracting the process of object generation in a way that the type of object instantiated can be determined at runtime. Prototype pattern is used to instantiate new object by copying all of the properties of an existing object, creating an independent clone. Singleton pattern ensures single object of a particular class. 12. Can you describe all seven structural patterns in one line? (Interviewer will not ask for all seven, only one or two)
  • 4. Ans. Adapter pattern is used to provide mechanism to link two incompatible types by wrapping the “adaptee” with a class that supports the interface required by the client. Bridge pattern is used to separate the abstract element of a class from the implementation details, providing the means to replace the implementation details without modifying the abstraction. Composite pattern is used to create hierarchical, recursive tree structures of related objects where any element of the structure may be accessed and utilized in a standard manner. Decorator pattern is used to extend or alter the functionality of objects at run-time by wrapping them in an object of a decorator class. Façade pattern is used to define a simplified interface to a more complex subsystem. Flyweight pattern is used to reduce the memory and resource usage for complex models containing many hundreds, thousands or hundreds of thousands of similar objects. Proxy pattern is used to provide a placeholder object, which references an underlying object. 13. Can you describe all eleven behavioral patterns in one line? (Interviewer will not ask for all eleven, only one or two) Ans. Chain of Responsibility pattern is used to process varied requests, each of which may be dealt with by a different handler. Command pattern is used to express a request, including the call to be made and all of its required parameters, in a command object. Interpreter pattern is used to define the grammar for instructions that form part of a language or notation, whilst allowing the grammar to be easily extended. Iterator pattern is used to provide a standard interface for traversing a collection of items in an aggregate object without the need to understand its underlying structure. Mediator pattern is used to reduce coupling between classes that communicate with each other by sending messages via a mediator object. Memento pattern is used to capture the current state of an object and store it in such a manner that it can be restored at a later time without breaking the rules of encapsulation. Observer pattern is used to allow an object to publish changes to its state. Other objects subscribe to be immediately notified of any changes. State pattern is used to alter the behavior of an object at runtime as its internal state changes. Strategy pattern is used to create an interchangeable family of algorithms from which the required process is chosen at run-time. Template Method pattern is used to define the basic steps of an algorithm and allow the implementation of the individual steps to be changed. Visitor pattern is used to separate a relatively complex set of structured data classes from the functionality that may be performed upon the data that they hold.