What's the first step you take for implementing any of Design Pattern?( .NET Design pattern interview questions with answers)
Every design pattern solves certain problems. At the end of the day they are tried and test solution for a certain architecture problem. So you first need to understand what the problem is and then choose design pattern accordingly. For instance below are some scenarios where the thought will flow as follows.
Problem: - You want to create a single instance of an object.Solution: - Singleton design pattern.
Problem: - Want to change the behavior of the class without altering the class.
Solution: - Decorator pattern.
Problem: - Want to loop through a collection without giving him modify access to collection.
Solution: - Iterator pattern.
Do see the below design pattern interview question video on factory patterns.