.NET

Clean Architecture

Layered architecture, CQRS, MediatR, repository pattern, separation of concerns, testability

20 면접 질문·
Mid-Level
1

What is the Clean Architecture principle?

답변

Clean Architecture organizes code into concentric layers where dependencies point only inward (toward the domain). The Domain layer (entities, business rules) has no infrastructure dependencies. Outer layers (UI, Database, API) depend on domain abstractions via Dependency Inversion. This ensures testability, framework independence, and code maintainability.

2

What are the main layers of Clean Architecture?

답변

Clean Architecture has 4 main layers: Domain (entities, business rules, repository interfaces), Application (use cases, DTOs, application logic), Infrastructure (repository implementations, DbContext, external services), and Presentation (API controllers, UI). Domain is at the center and depends on nothing. Application depends on Domain. Infrastructure and Presentation depend on Application and Domain.

3

What is the CQRS pattern?

답변

CQRS (Command Query Responsibility Segregation) separates read (Queries) and write (Commands) operations. Commands modify state and return void or a simple result. Queries return data without modifying state. This separation allows independent optimization of reads (Dapper, SQL views) and writes (EF Core, DDD aggregates), and different scaling for each side.

4

What is the role of MediatR in Clean Architecture?

5

How to define a Command in MediatR?

+17 면접 질문

다음 면접을 위해 .NET을 마스터하세요

모든 질문, flashcards, 기술 테스트, 코드 리뷰 연습, 면접 시뮬레이터에 접근하세요.

무료로 시작하기