# .NET 디자인 패턴 (.NET) > Singleton, Factory, Builder, Strategy, Decorator, Repository, Unit of Work, SOLID - 24 면접 질문 - Senior - [면접 질문: .NET](https://sharpskill.dev/ko/technologies/dotnet/interview-questions.md) ## 1. Dependency Injection을 사용하는 최신 .NET에서 Singleton 패턴의 주요 문제점은 무엇인가요? **답변** 전통적인 Singleton 패턴(정적 인스턴스)은 강한 결합을 만들고 테스트를 어렵게 만들기 때문에 dependency injection과 충돌합니다. 최신 .NET에서는 DI를 통한 'Singleton' 서비스 lifetime(services.AddSingleton)을 사용하는 것이 좋으며, 이는 단일 인스턴스 보장을 그대로 제공하면서 injection, mocking, 테스트 용이성을 가능하게 합니다. 정적 Singleton은 DI 컨테이너를 우회하고 숨겨진 의존성을 만듭니다. ## 2. Factory Method 패턴에서 .NET의 Factory Method와 Abstract Factory의 차이는 무엇인가요? **답변** Factory Method는 단일 타입의 객체(예: CreateLogger)를 생성하는 가상 메서드를 정의하여 서브클래스가 어떤 구체 클래스를 인스턴스화할지 결정하게 합니다. Abstract Factory는 관련된 객체 집합(예: CreateButton, CreateTextBox를 가진 IUIFactory)을 생성하는 interface를 정의하여 일관된 여러 제품을 함께 생성할 수 있게 합니다. Factory Method는 다형성을 통한 단일 제품에 초점을 두고, Abstract Factory는 동일 패밀리의 여러 제품을 관리합니다. ## 3. 많은 선택적 매개변수를 가진 복잡한 객체를 생성할 때, .NET에서 Builder 패턴의 주요 장점은 무엇인가요? **답변** Builder 패턴은 객체를 단계별로 구축하는 fluent interface를 제공함으로써 telescoping 생성자(서로 다른 매개변수 조합을 가진 여러 오버로드)를 피합니다. 10개 이상의 매개변수를 가진 생성자와 달리, 선택적 매개변수가 있는 복잡한 객체를 읽기 쉽고 유지보수하기 좋은 방식으로 생성할 수 있습니다. 최신 C#에서는 init 프로퍼티와 record가 단순한 경우 Builder를 대체할 수 있지만, 복잡한 검증이나 다단계 구축에는 Builder가 여전히 유용합니다. ## 21개 추가 질문 이용 가능 - SOLID에서 Single Responsibility Principle(SRP)이란 무엇이며 .NET에서 어떻게 적용하나요? - SOLID의 Open/Closed 원칙(OCP)이란 무엇이며 .NET에서 interface로 어떻게 구현하나요? 무료로 가입하기: https://sharpskill.dev/ko/login ## 기타 .NET 면접 주제 - [C# 기초](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/csharp-basics.md): 25개 질문, Junior - [LINQ & Delegates](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/csharp-linq-delegates.md): 20개 질문, Junior - [C# 언어 핵심 요소](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/csharp-language-essentials.md): 15개 질문, Junior - [ASP.NET Core 기초](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/aspnet-core-fundamentals.md): 18개 질문, Junior - [ASP.NET Core 요청 수명 주기](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/aspnet-core-request-lifecycle.md): 20개 질문, Junior - [Configuration & Settings](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/configuration-settings.md): 20개 질문, Junior - [애플리케이션 라이프사이클](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/application-lifecycle.md): 20개 질문, Junior - [Dependency Injection](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/dependency-injection.md): 24개 질문, Mid-Level - [Entity Framework Core](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/entity-framework-core.md): 25개 질문, Mid-Level - [Minimal APIs](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/minimal-apis.md): 18개 질문, Mid-Level - [Web API 개발](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/web-api-development.md): 22개 질문, Mid-Level - [ASP.NET Core의 Async](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/async-aspnet-core.md): 20개 질문, Mid-Level - [Authentication & Authorization](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/authentication-authorization.md): 18개 질문, Mid-Level - [HttpClient & 네트워킹](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/httpclient-networking.md): 20개 질문, Mid-Level - [JSON 직렬화](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/json-serialization.md): 20개 질문, Mid-Level - [Entity Framework Core 고급](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/ef-core-advanced.md): 25개 질문, Mid-Level - [C# 고급 기능](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/csharp-advanced-features.md): 20개 질문, Mid-Level - [Clean Architecture](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/clean-architecture.md): 20개 질문, Mid-Level - [Logging, Monitoring & Observability](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/logging-monitoring.md): 22개 질문, Mid-Level - [단위 테스트와 xUnit](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/unit-testing-xunit.md): 20개 질문, Mid-Level - [통합 테스트](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/integration-testing.md): 18개 질문, Mid-Level - [Docker & Containerization](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/docker-containerization.md): 16개 질문, Mid-Level - [NuGet 패키지 관리](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/nuget-package-management.md): 16개 질문, Mid-Level - [Memory Management & GC](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/memory-management-gc.md): 22개 질문, Senior - [리액티브 프로그래밍](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/reactive-programming.md): 24개 질문, Senior - [Async/await 및 패턴](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/async-await-patterns.md): 26개 질문, Senior - [성능 최적화](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/performance-optimization.md): 22개 질문, Senior - [보안 및 모범 사례](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/security-best-practices.md): 24개 질문, Senior - [SignalR 및 실시간](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/signalr-realtime.md): 22개 질문, Senior - [마이크로서비스 아키텍처](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/microservices-architecture.md): 25개 질문, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ko/technologies/dotnet/interview-questions/dotnet-design-patterns