Do you know design patterns. List few?



Do you know design patterns. List few?..

Answer / Pradeep Parashar

Yes, here are some common design patterns:
1. Singleton: Ensures a class has only one instance and provides a global point of access to it.
2. Factory: Defines an interface for creating objects without specifying their concrete classes.
3. Observer: Defines a one-to-many dependency between objects, so that when one object changes state, all its dependents are notified and updated automatically.
4. Strategy: Defines a family of algorithms and encapsulates each one as an individual object, making it easy to switch between them at runtime.
5. Decorator: Attaches additional responsibilities to an existing object dynamically without modifying its structure.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

Tell me what are the __construct() and __destruct() methods in a php class?

1 Answers  


How send email using php?

1 Answers  


Can we use php variable in javascript?

1 Answers  


What is the scope of career in PHP/Mysql

34 Answers   Verizon, VGT,


Tell me how to get the value of current session id?

1 Answers  


How many types of inheritances used in php and how we achieve it.

1 Answers  


How can we get the browser properties using PHP?

4 Answers   Google, Pollux Softech,


How to convert the first character to upper case?

1 Answers  


How to print \ in php. Only \ with out using . or *.

7 Answers   American Solutions,


What is the mysql injection?

1 Answers  


What are computer variables?

1 Answers  


Explain php explode() function.

1 Answers  


Categories