In 1994, four authors (known as the Gang of Four) published a book that changed software engineering forever. They identified 23 recurring problems in object-oriented software and provided "Blueprints" for solving them. These aren't code libraries; they are Patterns of Thought.
A design pattern is NOT a specific piece of code. It is a general, reusable solution to a commonly occurring problem within a given context in software design. Think of it as a "Shared Vocabulary" between developers. When an architect says, "Let's use a Decorator here," everyone knows exactly what the architecture will look like without writing a single line of code.
The GoF patterns are divided into three buckets based on what they do:
The most common mistake junior developers make is "Pattern Over-Engineering." They try to force a pattern into every single class. This leads to code that is impossible to read. Patterns should be used to DECREASE complexity, not increase it. If a simple 'if' statement works, you don't need a Strategy Pattern.
Q: "Can you name a design pattern currently used within the .NET Core Framework itself?"
Architect Answer: "Absolutely. The `Middleware` pipeline in ASP.NET Core is a perfect implementation of the **Chain of Responsibility** pattern. Every time you use `app.UseRouting()`, you are adding a link to a chain. Each link decides whether to process the HTTP request or pass it to the next link. Another example is `HttpClientFactory`, which is a **Factory Pattern** used to manage the lifecycle of sockets and prevent DNS-related memory leaks."