Ctrl K
QA · Senior · Theory

How 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?

~4 min by voice

How to approach it

This checks whether you understand the nature of a message broker (at-least-once, ordering only within a partition, asynchrony) and can turn those properties into concrete, stable automated tests instead of relying on sleep and the happy path.

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. SeniorA queue consumer processes "award bonus points" messages, and sometimes users get their bonus twice. Why does this happen, and how do you fix it? Mid-levelA 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? Mid-level

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