Ctrl K
Backend · Mid-level · Theory

A service saves an order to the database and then publishes an "order created" event to a message broker. What problems can come up here, and how do you solve them?

~4 min by voice

How to approach it

The interviewer wants to see whether you spot the dual write problem, the lack of atomicity between the database and the broker, and whether you can solve it with a Transactional Outbox while understanding the delivery guarantees (at-least-once) and what they mean for consumers.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics
Similar questionsСервис заказов после оплаты кладёт событие в очередь, а сервис уведомлений его читает и отправляет пользователю пуш. Какие гарантии доставки бывают, почему пользователь может получить пуш дважды или не получить вовсе, и как это чинить? И как вы гарантируете порядок событий одного заказа? Mid-levelWhat is a message queue, and when should backend processing be moved into an asynchronous queue? JuniorDesign a distributed rate limiter for a public API: limits are set per client key, and requests are handled by dozens of gateway instances. SeniorDesign a notification service for push, email and SMS, handling about fifty million notifications a day, with spikes during marketing campaigns. SeniorThe main table in your database has grown to several terabytes, and a single instance can no longer keep up with the writes. How would you design the move to sharding? Senior

Answer by voice

The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.

Sign in to answer

Best with headphones · ~4 min