1325 questions for senior .NET engineer interviews, each with a 30-second answer, the full answer, a deep dive, the follow-ups interviewers ask next, and real-world production problems.
Sagas, outbox and inbox, distributed transactions and two-phase commit, event sourcing, event replay and event versioning for keeping data consistent across services.
Two-phase commit and distributed transactions: the prepare and commit protocol, its blocking and availability failure modes, current .NET and Azure support (MSDTC on Windows only, elastic transactions, no broker enlistment), and the replacements: one transaction by design, outbox with idempotent consumers, sagas, reservations and reconciliation.
Event replay in event-sourced and event-driven systems: rebuilding projections from the event store or a retained log, checkpoints and positions, blue-green projection rebuilds, separating projections from side-effect handlers, idempotent and deterministic handlers, and replay speed and ordering.
Event versioning for event stores and integration events: weak-schema tolerant readers, upcasting chains at read time, new event types and parallel publishing for breaking changes, copy-and-transform migrations, schema registries (Confluent, Azure Schema Registry) with backward, forward and full compatibility, and System.Text.Json behaviour.
Choosing a consistency mechanism for a multi-step process: when to keep data in one service and one transaction, when an outbox with idempotent consumers and eventual consistency is enough, and when a saga (orchestrated or choreographed) with compensations and timeouts is needed, plus reservations, the UX of pending states and the operating cost.
A real-world cross-service money inconsistency: tracing a transfer by correlation id through the ledger, outbox, broker, dead-letter queues, inbox and saga state; containing the damage; repairing with idempotent, audited compensating or completing commands driven by a reconciliation report; and preventing recurrence with reconciliation, outbox-age and DLQ alerts.