A production-grade collection of 35+ design patterns implemented in .NET 10 / C# 13, organized for learning, interview preparation, and real-world architecture reference.
Every pattern uses a realistic business scenario — payment processing, cloud storage, healthcare IoT, order fulfillment, fraud detection, and more. No abstract Shape or Animal examples.
Who This Repository Is For
Backend developers who want to deeply understand design patterns through real .NET code
Interview candidates preparing for system design and coding interviews
Architects looking for a production-style reference of pattern implementations
Students who want to go beyond textbook examples
What Is Free
All source code, tests, and introductory documentation are freely available:
Free Content
Description
Source Code
236 C# files implementing 35+ patterns with realistic business scenarios
Summary docs for all four categories (Creational, Structural, Behavioral, Enterprise)
Pattern Indexes
Quick-reference listings with one-paragraph summaries per pattern
What Is Premium
Deep-dive content, interview prep, and architecture guidance are available through the learning platform:
Premium Content
Description
Deep Dives
10 in-depth pattern analysis articles (Factory Method, Builder, Decorator vs Proxy, Strategy vs State, CQRS, Saga, and more)
Anti-Patterns Guide
12 anti-patterns with symptoms, code smells, and better alternatives
Interview Cheat Sheet
Master revision guide with one-liners, common questions, and tradeoff tables for all 35+ patterns
Decision Matrix
Problem-to-pattern mapping with Mermaid decision flowcharts
Comparison Maps
10 side-by-side pattern comparisons with diagrams
Premium Blog Posts
Production-focused articles on building resilient APIs, implementing sagas, and more
Premium access is delivered through the main learning platform. This repository contains all code and free docs; premium content is marked accordingly.
Learning Path
Beginner Path
Step
Pattern
Why Start Here
1
Strategy
Simplest behavioral pattern — just swap algorithms
2
Factory Method
Most common creational pattern in .NET
3
Observer
Foundation of event-driven programming
4
Decorator
Understand composition over inheritance
5
Builder
Essential for complex object construction
Then explore: Adapter, Facade, State, Command, Template Method.
Interview Prep Path
Priority
Patterns
Interview Topic
High
Strategy, Factory Method, Observer
"Which pattern would you use for...?"
High
Singleton
Thread safety, DI alternative
High
CQRS, Repository, Unit of Work
Data access architecture
Medium
Decorator, Proxy, Adapter
Structural composition
Medium
State, Command, Chain of Responsibility
Behavioral workflows
Architect Path
Domain Modeling: Value Object, Specification, Domain Events, Result Pattern
Data Pipeline: Repository + Unit of Work + Specification
Any IDE: Visual Studio 2025, VS Code with C# Dev Kit, JetBrains Rider
Run Examples
bash
# Run the interactive playground
dotnet run --project src/DesignPatterns.Playground
# Run all tests
dotnet test
# Run tests for a specific category
dotnet test tests/DesignPatterns.Creational.Tests
# Build the entire solution
dotnet build