CQRS, MediatR and mediators, Repository, Unit of Work and Specification at the architecture level, domain and integration events, event sourcing, sagas, outbox and inbox.
-
In Domain-Driven Design, how would you implement domain event dispatch with EF Core so the domain event handlers run in the same transaction as the aggregate change?
Intermediate
Theory
Architecture Patterns
-
What is the difference between a domain event and an integration event? Explain in-process versus cross-service delivery, when each should be dispatched relative to SaveChanges, and how the transactional outbox connects the two.
Domain events versus integration events in a .NET 10 architecture: scope, contracts, dispatch timing around EF Core SaveChanges, translating one into the other, and using the outbox for reliable cross-service publishing.
Intermediate
Theory
Architecture Patterns
Β· π 3 follow-ups Β· π 1 real-world
-
Show me how you would implement domain events with EF Core 10: collecting them on aggregates, dispatching them from a SaveChangesInterceptor, and keeping the handlers' changes consistent with the original save. What can go wrong?
A working EF Core 10 implementation of domain events: an aggregate base class, a SaveChangesInterceptor that collects and dispatches events before commit, transaction and execution-strategy handling, and the failure modes such as recursion, lost events and re-entrancy.
Mid-Level
Coding
Architecture Patterns
Β· π 4 follow-ups Β· π 1 real-world
-
What is event sourcing? Explain storing events instead of current state, how projections and snapshots work, how you version events, and when event sourcing is worth its cost and when it is not.
Event sourcing at the architecture level: the event store and streams, rebuilding aggregates, projections and read models, snapshots, event schema evolution and upcasting, .NET tooling (Marten, KurrentDB, Eventuous), and the criteria for using or avoiding it.
Senior
Theory
Architecture Patterns
Β· π 3 follow-ups Β· π 1 real-world
-
You're designing a system where reads outnumber writes 50 to 1 and the read screens need data from several modules. How would you apply CQRS at the architecture level: separate read stores, projections, handling eventual consistency in the UX, and deciding whether you also need event sourcing?
Architecture-level CQRS for a read-heavy .NET system: the spectrum from split handlers to separate read stores, building projections from events or change feeds, choosing the read store, designing UX for eventual consistency, and why CQRS does not require event sourcing.
Senior
Architecture
Architecture Patterns
Β· π 3 follow-ups Β· π 1 real-world
-
Your team is starting a vertical-slice .NET 10 codebase and someone proposes MediatR for every request. How do you evaluate whether you need a mediator at all? Cover the cost of indirection, pipeline behaviours versus ASP.NET Core filters, MediatR's licence change, and how you would move an existing codebase off it.
An architecture decision on mediators in .NET 10: what MediatR gives a vertical-slice codebase, the indirection and performance costs, built-in alternatives (endpoint filters, direct handler injection), source-generated and Wolverine alternatives, MediatR's commercial licensing as of late 2026, and an incremental migration plan.
Senior
Architecture
Architecture Patterns
Β· π 3 follow-ups Β· π 1 real-world
-
In a Clean Architecture .NET solution, where do the Repository, Unit of Work and Specification abstractions live, and how do you use them without leaking EF Core into the Application and Domain layers? When would you skip them and use DbContext directly?
Architecture-level placement of Repository, Unit of Work and Specification in Clean Architecture: interfaces in Domain or Application, implementations in Infrastructure, one repository per aggregate, DbContext as the unit of work, avoiding IQueryable and EF types in the core, and when using DbContext directly is the better choice.
Mid-Level
Theory
Architecture Patterns
Β· π 3 follow-ups Β· π 1 real-world
-
How do you design and evolve integration event contracts between .NET services? Explain schema versioning, the CloudEvents envelope, who owns a contract, and why a shared NuGet library of event classes used by every service causes coupling.
Integration event contracts in a .NET service landscape: publisher ownership, backward- and forward-compatible schema changes, versioned event types, the CloudEvents envelope and Azure Service Bus mapping, schema registries and contract tests, and the coupling caused by a shared events library.
Mid-Level
Theory
Architecture Patterns
Β· π 2 follow-ups Β· π 1 real-world
-
Walk me through an end-to-end order flow across Ordering, Payment and Inventory services that uses the outbox, the inbox and an orchestrated saga. At each step, what happens if a service crashes, a message is duplicated, or a reply never arrives?
An architecture walkthrough of a cross-service order flow in .NET: outbox publishing, inbox deduplication, a persisted saga orchestrator with compensations and timeouts, and a failure-point analysis covering crashes, duplicates, lost replies and poison messages.
Senior
Architecture
Architecture Patterns
Β· π 3 follow-ups Β· π 1 real-world
-
After a release, customers' loyalty balances and order statuses in the Customer service are sometimes wrong: an order shows as Shipped then reverts to Paid, and some points are credited twice. The Customer service consumes integration events from Ordering over Azure Service Bus. How do you investigate and fix the ordering, versioning and idempotency problems?
A production incident with out-of-order and duplicate integration events corrupting a consumer's state: diagnosing with traces and Service Bus metrics, then fixing with aggregate versions, Service Bus sessions, inbox deduplication, idempotent operations and contract version handling, plus safe data repair.
Senior
RealWorldScenario
Architecture Patterns
Β· π 3 follow-ups Β· π 1 real-world