TOP 10 Interview Answers: Design Patterns Questions &
TOP 10 Interview Answers: Design Patterns Questions &
TOP 10 Interview Answers: Design Patterns Questions &
DESIGN PATTERNS
INTERVIEW
QUESTIONS &
ANSWERS
Q1.
WHAT IS SINGLETON
PATTERN?
Ensures that a class has only one instance
and provides a global point of access to it.
EXAMPLES
Need a single instance of an object
throughout the application
• Exception Logging
• Database Manager
• Business Layer Manager
Q3.
WHAT IS FACTORY
PATTERN?
Allow us to create object without exposing
the creation logic.
EXAMPLES
WHAT IS BUILDER
PATTERN?
Used to build a complex object by using a
step by step approach. Builder interface
defines the steps to build the final object.
EXAMPLES
WHAT IS ADAPTER
PATTERN?
Acts as a bridge between two incompatible
interfaces.
EXAMPLES
WHAT IS FACADE
PATTERN?
Hides the complexities of the system and a
higher-level interface that makes the
subsystem easier to use.
EXAMPLES
WHAT IS BRIDGE
PATTERN?
Separate abstraction from its implementation
so that both can be modified independently.
Involves an interface that acts as a bridge
between the abstraction & implementation.
EXAMPLES
In Payment using Credit Card & Debit
Card but in future add more like UPI.
In Messaging using SMS and Email but in
future add more like WhatsApp.
Q8.
WHAT IS COMMAND
PATTERN?
A request is wrapped under an object as a
command and passed to the invoker object.
Further invoker object passes the command
to the appropriate object to handle it.
EXAMPLES
WHAT IS STATE
PATTERN?
Allows an object to alter its behavior when
its internal state changes.
EXAMPLES
WHAT IS OBSERVER
PATTERN?
Allows a single object to publish its state
changes to other observer objects that
depend upon it.
EXAMPLES
hello@scholarhat.com
www.scholarhat.com