# Restaurant tablet offline, order still arrives: Message queues (Mock Interview Notes)

> How to answer the lost-order interview question: why calling the restaurant directly with 3 retries is the weak answer, how a message queue holds the order...

Canonical: https://www.internhack.in/notes/message-queue-interview
Last updated: 2026-11-05

By InternHack Team · 2026-11-05 · 11 min read · Interview Prep

The interview question: **"You place a ₹349 biryani order. The restaurant's tablet is offline for 2 minutes (it's on charge), and the notification service has crashed too. The order must still reach the restaurant, and you must still get the 'order accepted' push. How do you make sure?"**

Food delivery apps run on exactly this kind of plumbing. Zomato's own engineering blog says that on New Year's Eve 2023, "the order rate skyrocketed to 8400 orders per minute", and that Kafka, "the backbone of our event-driven architecture", handled "450+ million messages per minute". (To be clear: the biryani and the charging tablet are an example scenario, not a real Zomato incident. No source we found describes Zomato's actual order-to-restaurant pipeline or any lost order.)

In these notes: the weak answer and why it fails, how a queue holds the order, when the consumer should confirm (ack), why the same order can arrive twice, the idempotent consumer fix, dead-letter queues, keeping one order's events in order, the outbox pattern, and a ready interview answer.

## The weak answer: "Call the restaurant directly, retry 3 times"

A typical fresher answer: *"Sir, the order API will call the restaurant service directly. If it fails, we retry 3 times, then show an error."*

Here's why the interviewer pushes back:

- **The tablet is offline for 2 minutes. Three retries finish in about 3 seconds.** After that, what? Either the customer sees an error after paying, or worse, the order is saved in your database and the restaurant never hears about it.
- **Everything is chained.** If the order API waits on the restaurant service and then the notification service, the order API is only as available as the weakest service in the chain. One of them down = orders fail. (This is standard reasoning, not a quote from a source.)
- **Blind retries can double-place.** If the first call actually reached the restaurant but the response got lost, the retry sends the order again.

The strong answer is **asynchronous messaging**: the order service writes the order, drops a message in a queue, and says "order placed" right away. The restaurant and notification services read that message whenever they are alive. One-liner to remember: **"Don't call, leave a slip. And don't tear the slip until the work is done."**

## Sign up free to unlock the full notes

The rest of these notes needs a free InternHack account:

- The dhaba analogy
- Step by step: what the queue actually does
- Why the same order can arrive twice
- The fix: an idempotent consumer
- Keeping one order's events in order
- Edge cases
- Kafka, RabbitMQ or SQS?
- How to answer this in an interview
- The reel's question: one biryani or two?

Sign up free: https://www.internhack.in/register?from=%2Fnotes%2Fmessage-queue-interview

## Sources

- Zomato Engineering blog, "A Tale of Scale: Behind the Scenes at Zomato Tech for NYE 2023" (29 Feb 2024; 8400 orders per minute, 450+ million Kafka messages per minute, Kafka as "the backbone of our event-driven architecture"): https://blog.zomato.com/a-tale-of-scale-behind-the-scenes-at-zomato-tech-for-nye-2023
- Apache Kafka, introduction (event keys, partitions, ordering, events not deleted after consumption): https://kafka.apache.org/intro
- Confluent docs, Kafka delivery semantics (at-least-once by default, reprocessing after a crash): https://docs.confluent.io/kafka/design/delivery-semantics.html
- Confluent docs, Kafka consumer configs (enable.auto.commit, auto.commit.interval.ms): https://docs.confluent.io/platform/current/installation/configuration/consumer-configs.html
- Confluent docs, Kafka broker configs (log.retention.hours = 168): https://docs.confluent.io/platform/current/installation/configuration/broker-configs.html
- RabbitMQ docs, consumer acknowledgements and publisher confirms (requeue of unacked deliveries, redeliver flag): https://www.rabbitmq.com/docs/confirms
- RabbitMQ docs, dead letter exchanges: https://www.rabbitmq.com/docs/dlx
- AWS docs, SQS visibility timeout (30 s default, at-least-once, FIFO message groups): https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
- AWS docs, SQS dead-letter queues: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html
- AWS docs, SQS SetQueueAttributes (retention defaults, maxReceiveCount default 10): https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SetQueueAttributes.html
- microservices.io, Idempotent Consumer pattern: https://microservices.io/post/microservices/patterns/2020/10/16/idempotent-consumer.html
- Conduktor, building idempotent consumers (secondary): https://www.conduktor.io/blog/building-idempotent-consumers
- PracHub, Kafka vs RabbitMQ for system design interviews (secondary): https://prachub.com/resources/kafka-vs-rabbitmq-architectural-differences-for-system-design-interviews

The biryani order and the charging tablet are an example scenario: no source describes Zomato's restaurant-tablet path, which queue it uses for orders, or a lost-order incident. The auto-commit gotcha, the visibility-timeout edge case, the outbox pattern, "no global ordering needed" and the Kafka vs RabbitMQ vs SQS comparison are general knowledge or our reasoning, not quotes from the primary sources above.

## Related

- [Home](https://www.internhack.in/)
- [Notes](https://www.internhack.in/notes)
