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 notification service for push, email and SMS, handling about fifty million notifications a day, with spikes during marketing campaigns. SeniorYour service makes synchronous calls to an external service that sometimes responds very slowly or with errors. How do you keep that from taking your service down? Mid-levelHow do you test a service that processes events from a queue, for example from Kafka, and how do you deal with asynchrony in automated tests? 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