.NET

Clean Architecture

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

20 mülakat soruları·
Mid-Level
1

What is the Clean Architecture principle?

Cevap

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?

Cevap

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?

Cevap

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 mülakat soruları

Bir sonraki mülakatın için .NET'de uzmanlaş

Tüm sorulara, flashcards'a, teknik testlere, code review alıştırmalarına ve mülakat simülatörlerine eriş.

Ücretsiz başla