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.
Azure Service Bus, RabbitMQ, Kafka, Amazon SQS and AMQP, queues and pub/sub, competing consumers, dead-letter queues, poison messages, message ordering and delivery guarantees (at-most-once, at-least-once and the exactly-once myth).
Covers point-to-point queues versus publish/subscribe topics and subscriptions, the competing consumers pattern, the kinds of decoupling a broker gives (time, location, load) and when synchronous HTTP is still the right choice.
Compares queue brokers (Azure Service Bus, RabbitMQ, Amazon SQS) with Kafka's partitioned log on model, ordering, retention and replay, delivery guarantees, throughput and operations, and gives a decision approach for .NET teams.
Covers at-most-once and at-least-once delivery, where duplicates come from, why end-to-end exactly-once delivery is impossible over an unreliable network, what broker features (Kafka idempotent producer and transactions, Service Bus duplicate detection, SQS FIFO dedup) actually guarantee, and how idempotent consumers deliver effectively-once processing.
Covers building a production Service Bus consumer with ServiceBusProcessor in a BackgroundService: settlement (complete, abandon, dead-letter), MaxConcurrentCalls and PrefetchCount, auto lock renewal, graceful shutdown with cancellation, error handling, DI with Microsoft.Extensions.Azure and idempotent processing.
Covers why ordering is expensive, per-key ordering with Service Bus sessions, Kafka partitions and SQS FIFO message groups, what breaks order (parallel consumers, retries, DLQ, rebalancing, repartitioning), and design alternatives: commutative updates, version numbers and state-carrying events.
Covers diagnosing a growing Service Bus backlog with poison messages: reading DLQ reasons and properties, distinguishing poison messages from a failing dependency, settlement mistakes that cause loops, safe DLQ resubmission, scaling consumers against the downstream limit, and alerting and testing to prevent recurrence.
Covers Kafka's partitioned log model, consumer groups and partition assignment, offset commit strategies in Confluent.Kafka (auto commit, StoreOffset, manual Commit), rebalancing (eager versus cooperative-sticky, max.poll.interval.ms), consumer lag and its causes, and the resulting at-least-once guarantee with idempotent processing.
Covers recovering from a 2-million-message backlog after an outage: assessing message types and staleness, throttled draining sized to the downstream, prioritising new traffic, ordering and idempotency during catch-up, discarding or archiving expired messages, monitoring progress and communicating ETAs to stakeholders.
Covers reviewing a message handler with side effects: duplicate courier bookings from at-least-once delivery, swallowed exceptions with auto-complete, the dual write between the database and the broker, missing idempotency keys, lost cancellation, blocking calls, logging gaps, and a rewrite using an inbox, outbox and provider idempotency key.