All 65 questions
How would you prevent duplicate business effects when a message is redelivered, including after a crash?
Asked in 12 of 169 interviews · last asked Oct 18 · Design · Senior
Show answer
I would use a stable payment ID as an idempotency key and enforce uniqueness in durable storage. For a local credit, I would save the credit and processed ID in one database transaction, then acknowledge the message. Redelivery after a crash would not repeat the credit. For external payments, use provider-supported idempotency or reconcile uncertain outcomes.
- Use a database uniqueness constraint, not only an in-memory check, to handle restarts and concurrent deliveries.
- Acknowledge the message or commit its Kafka offset only after the database transaction commits.
- For external payments with unknown outcomes, retry with the same idempotency key or reconcile with the provider.
- Enforce valid state transitions: late events must not repeat credits or move settled payments back to intermediate states.
What the interviewer checks: The interviewer is checking whether your design prevents repeated business effects across retries, concurrent deliveries, and crashes.
Other ways it was asked
- “If a service restarts and an external service resends the same message for a 50,000-peso payment, how would you prevent the recipient from receiving 100,000 pesos?”
- “If an external service resends the same 50,000-peso payment message after your service restarts, how would you prevent the recipient from receiving the payment twice?”
- “How would you design the system so that if a service restarts and an external service resends the same 50,000-peso credit message, the customer is not credited twice? How would you handle a late event indicating that the transaction is already settled or in an intermediate state?”
How do you handle failed events in a message consumer, including retries and dead-letter queues?
Asked in 3 of 169 interviews · last asked Aug 20 · Scenario · Mid-level
Show answer
I retry temporary failures with a limit, exponential backoff, and jitter. I send invalid events or events that exhaust retries to a dead-letter queue with error details. I acknowledge messages or commit offsets only after successful processing or durable handoff. I make processing idempotent so redelivery does not repeat side effects.
- Do not retry permanent errors, such as invalid data.
- Monitor the dead-letter queue, fix the cause, and replay events safely.
- Retry topics avoid blocking consumption but can change processing order.
- In Kafka, do not commit past an earlier event unless it is processed or durably handed off.
What the interviewer checks: The interviewer checks whether you can recover from failures without losing events or repeating side effects.
Other ways it was asked
- “What architectural pattern would you use to handle errors in a Kafka-based system?”
- “What should a message consumer do with an event it cannot process?”
- “How do you handle events, and what do you do when a consumer fails?”
What is the outbox pattern, and how does it prevent lost events after database commits?
Asked in 2 of 169 interviews · last asked Sep 18 · Concept · Mid-level
Show answer
The outbox pattern saves a business change and its event in the same database transaction. A separate process reads committed outbox events and publishes them to the message broker. If the application crashes after the commit, the event stays in the outbox for later delivery. Retries can create duplicates, so consumers must handle them safely.
- The business change and outbox event either both commit or both roll back.
- A publisher uses polling or change data capture to find committed events.
- Mark an event as sent only after the broker confirms publication.
- Delivery is usually at least once; use event IDs or idempotent processing to handle duplicates.
What the interviewer checks: The interviewer checks whether you can avoid lost events without assuming a database write and broker publish are atomic.
Other ways it was asked
- “What is the Outbox pattern, and what problem does it solve?”
- “What would you do if the application crashed after writing to the database but before publishing the event?”
How should an order service handle a connection failure when publishing a message to Azure Service Bus?
Asked once · last asked Sep 4 · Scenario · Senior
If a message broker such as Kafka delivers messages more than once or out of order, how should the payment service handle them to avoid deducting payment more than once?
Asked once · last asked Jan 30 · Scenario · Senior
What is exactly-once processing in Kafka?
Asked once · last asked Feb 18 · Concept · Mid-level
How would you configure exactly-once processing in a Kafka cluster, and which property would you change?
Asked once · last asked Feb 18 · Tooling · Mid-level
How would you pass 50-millisecond audio chunks while preserving their order?
Asked once · last asked Feb 27 · Scenario · Senior
How is message ordering handled or guaranteed in Kafka?
Asked once · last asked Mar 6 · Concept · Senior
Suppose the Kafka consumer crashes before processing a message. How do you ensure the message is processed successfully?
Asked once · last asked Mar 6 · Scenario · Senior
What happens to a message in a RabbitMQ queue after a consumer reads it?
Asked once · last asked Mar 6 · Concept · Mid-level
How do you handle message acknowledgments and retry logic to ensure tasks are processed reliably?
Asked once · last asked Mar 17 · Scenario · Senior
Regarding exactly-once delivery, what steps would you implement?
Asked once · last asked Mar 17 · Scenario · Senior
How would you ensure delivery guarantees and handle notifications that fail to reach a user's device?
Asked once · last asked Mar 19 · Scenario · Senior
How would you ensure alerts are reliably delivered to human reviewers, even if the notification service experiences downtime or message loss?
Asked once · last asked Mar 27 · Scenario · Senior
How would you ensure an order-created event is not lost and is eventually processed if a service restarts after the customer has received confirmation?
Asked once · last asked Apr 13 · Design · Senior
How do you ensure exactly-once processing and prevent duplicate writes in a production ETL pipeline when upstream systems retry or deliver late, out-of-order events?
Asked once · last asked May 3 · Design · Senior
Assume the root cause was a Flink job restart that replayed Kafka messages, while the ClickHouse sync was not idempotent. What would you do, and how would you resolve it?
Asked once · last asked May 12 · Scenario · Senior
How do you implement idempotency for a Lambda that can be retried, including timeouts or partial failures while writing to DynamoDB and publishing an event? What's your approach to avoiding duplicates end to end?
Asked once · last asked May 29 · Scenario · Senior
How would you ensure that messages are not lost when processing a queue?
Asked once · last asked Jun 9 · Scenario · Senior
How can an event-driven architecture help address race conditions in order processing?
Asked once · last asked Jun 18 · Concept · Senior
How does Azure Service Bus preserve message-processing order in a distributed system when multiple consumers handle nearly simultaneous flash-sale orders?
Asked once · last asked Jun 18 · Design · Senior
If only one unit of stock remains and two customers order at the same time, how would you prevent overselling, and when would you validate or lock the stock relative to publishing an event?
Asked once · last asked Jun 18 · Scenario · Senior
If an SQS message invokes a Lambda function but the function does not report success or failure, what will SQS do?
Asked once · last asked Jun 23 · Scenario · Senior
How do you decide whether a delayed or previously failed event is still safe to replay?
Asked once · last asked Jun 25 · Scenario · Senior
Other ways it was asked
- “After fixing a processing failure, how should you decide whether a failed event is still valid to replay?”
- “If event processing order matters, under what conditions can a delayed event be processed a week later?”
How would you preserve the order of updates to Redis and PostgreSQL when using an asynchronous message queue?
Asked once · last asked Jun 29 · Scenario · Senior
What information in a dead-letter queue is most useful for identifying the root cause of failed asynchronous updates?
Asked once · last asked Jun 29 · Scenario · Mid-level
How would you adjust a request flow to keep an asynchronous pipeline consistent?
Asked once · last asked Jul 5 · Scenario · Senior
How would you tune retry behavior and the backoff strategy for an asynchronous pipeline?
Asked once · last asked Jul 5 · Scenario · Senior
How would you keep an order service and a subscription service consistent when the order service publishes an order-created event?
Asked once · last asked Jul 23 · Scenario · Senior
How would you ensure exactly-once processing semantics in a streaming pipeline, particularly with checkpointing, late-arriving data, and output to Delta Lake?
Asked once · last asked Aug 11 · Scenario · Senior
How would you prevent duplicate processing and ensure correct ordering when consumers receive the same event multiple times or out of order?
Asked once · last asked Aug 11 · Design · Senior
How would you coordinate a webhook payload, a database write, and a queue when processing an incoming webhook?
Asked once · last asked Aug 26 · Design · Senior
How do we mitigate or prevent data loss and orphaned records if Redis crashes and Sidekiq loses the job queue?
Asked once · last asked Aug 26 · Scenario · Senior
Your application received duplicate messages from Amazon SQS. Is that necessarily a bug?
Asked once · last asked Aug 30 · Concept · Mid-level
How would you ensure reliable message delivery and handle traffic spikes in an Azure Service Bus consumer?
Asked once · last asked Sep 1 · Design · Senior
How would you implement retries for a failed background job: requeue the message or retry within the same worker?
Asked once · last asked Sep 3 · Design · Mid-level
If a notification service is unavailable, how can an architecture ensure queued notifications are delivered when it recovers, and where should that logic reside?
Asked once · last asked Sep 4 · Scenario · Senior
Where should message retries be handled in an architecture using Azure Service Bus: in the service, the broker, or a consumer?
Asked once · last asked Sep 4 · Concept · Senior
When two Celery workers process the same email after a Gemini request fails and retries, how could duplicate database writes or inconsistent state occur, and how would you prevent them without relying on a lock?
Asked once · last asked Sep 6 · Scenario · Senior
What happens to a Pub/Sub message if it is not delivered to the downstream target?
Asked once · last asked Sep 10 · Scenario · Mid-level
How do you guarantee message ordering and idempotent deduplication across retries when publishing from the outbox?
Asked once · last asked Sep 11 · Design · Senior
What consistency trade-offs would you accept between ledger commit and event processing?
Asked once · last asked Sep 11 · Design · Senior
Other ways it was asked
- “What consistency tradeoffs did you accept between ledger commit and event processing?”
What are the must-have edge cases and failure mode tests when designing an idempotent order creation API with a database and message outbox?
Asked once · last asked Sep 16 · Scenario · Senior
How would you precisely specify the correctness requirements for the outbox processor and test requirements around ordering, delivery guarantees, deduplication keys, and retry backoff?
Asked once · last asked Sep 16 · Scenario · Senior
How would you design the outbox table and locking strategy so multiple workers can process in parallel without breaking per-aggregate ordering?
Asked once · last asked Sep 16 · Design · Senior
How would you detect and recover from outbox failure modes, like DB commit succeeding but broker publish failing, or broker publish succeeding but DB update failing, without duplicates or reordering?
Asked once · last asked Sep 16 · Scenario · Senior
How would you ensure the permission-change event is reliably delivered and processed exactly once or effectively once across services so caches don't miss invalidations?
Asked once · last asked Sep 16 · Design · Senior
How would you prevent data loss and duplicate processing when delivering messages through Azure Service Bus?
Asked once · last asked Sep 18 · Scenario · Senior
What should happen if a consumer crashes while processing a message?
Asked once · last asked Sep 23 · Scenario · Senior
In an ASP.NET Core endpoint that queries a database, calls an external service, and publishes to Azure Service Bus, how would you handle a client disconnect, including where to propagate CancellationToken and where to prevent cancellation?
Asked once · last asked Sep 23 · Design · Senior
Other ways it was asked
- “Imagine an ASP.NET Core API endpoint that queries a database, calls an external service, and then publishes to Azure Service Bus. The client disconnects halfway through. How would you design cancellation handling through that flow? Where would you use CancellationToken, and where would you not allow cancellation?”
How would you handle out-of-order, duplicate, and missing sensor messages in an MQTT-based asset-monitoring system?
Asked once · last asked Oct 9 · Scenario · Senior
How does RabbitMQ help ensure that messages it receives are not lost?
Asked once · last asked Oct 15 · Concept · Senior
What is the difference between a dead-letter queue and a backout queue?
Asked once · last asked Oct 15 · Concept · Mid-level
How would you implement a retry mechanism with exponential backoff for a message processing system?
Asked once · last asked Oct 15 · Scenario · Senior
When should a Kafka consumer commit its offset relative to completing the database work?
Asked once · last asked Oct 18 · Concept · Senior
Other ways it was asked
- “If the database transaction commits but the Kafka consumer fails before committing the offset, what should happen?”
What failure mode can occur if a Kafka consumer writes an order to the database and records the event as processed in a separate transaction?
Asked once · last asked Oct 18 · Scenario · Senior
How do you prevent application delays when a consumer crashes after updating the database but before acknowledging a message?
Asked once · last asked Oct 20 · Scenario · Senior
If the notification queue is down for thirty minutes, what should your system do to avoid impacting the payment API and how would it recover afterward?
Asked once · last asked Oct 22 · Scenario · Senior
How would you write a Python program to handle failures when using Amazon SNS or Amazon SQS?
Asked once · last asked Oct 23 · Write code · Mid-level
In Python, if you need to process millions of events with strict per-key ordering but maximum overall throughput, how would you design the consumer architecture?
Asked once · last asked Oct 24 · Design · Senior
Does Kafka preserve the order of events?
Asked once · last asked Mar 6 · Concept · Mid-level
Other ways it was asked
- “How can you preserve event ordering in Kafka?”
What happens in the dead letter queue or dead letter topic?
Asked once · last asked Sep 10 · Concept · Mid-level
Which failure mode in a database-outbox architecture concerns you most, and why?
Asked once · last asked Sep 16 · Scenario · Senior
How would you make the event handler idempotent?
Asked once · last asked Oct 24 · Scenario · Mid-level
More Kafka and Message Queues interview questions
- All Kafka and Message Queues interview questions
- Stream Processing and Kafka Data Pipeline Interview Questions
How this list is made
Every question here was asked by a real interviewer in a real job interview that a candidate ran MeetAssist in. After the call, the interviewer's questions are pulled from the transcript. Practice sessions, tests, exams and anything that was not a job interview are dropped.
Questions are rewritten so they make sense on their own: names of people, employers and clients are removed, and speech-to-text mistakes are fixed. Small talk, logistics and questions about one candidate's own résumé are left out. Rephrasings of the same question are merged, and the count is the number of different interviews it came up in.
The interviews come from candidates who use MeetAssist, so they lean towards software, data and AI roles: the shares describe these interviews, not every Kafka and Message Queues interview. Answers to the most asked questions are written and checked by an editor; a "common mistake" is shown only when reviews of real answers in these interviews show it, with the count.
169 interviews, 104 candidates, Jan 2026 to Oct 2026. Updated every month with new interviews.
Or add the Chrome extension