Guia de entrevista · System Design

Queue vs Pub/Sub?

do caderno de estudos · atualizado em 2 de outubro de 2026
Para quem vai encarar entrevista de System Design2 min

Resposta curta e em inglês, para ler, fechar e treinar em voz alta.

A resposta, como você fala na entrevista

A work queue lets competing workers consume tasks. Standard SQS permits duplicate delivery, including when a worker completes an effect but fails before deleting the message. A visibility timeout temporarily hides an in-flight message, not a guarantee of exclusive execution forever.
Pub/Sub fans an event out to subscriptions, each with its own delivery behavior. A subscription can feed a queue so its workers share that copy of the work.
Kafka retains a partitioned log. Ordering is per partition, and consumer groups track their own progress. Members of one group share partitions, while separate groups can read the same events independently.
Define acknowledgments, bounded retries, replay, retention, and deduplication. Configure a dead-letter path for repeatedly failing work where supported, plus inspection and recovery. It is not automatic in every broker.

Source: SQS at-least-once delivery.

Ler é o primeiro passo. No app, essa pergunta vira flashcard com repetição espaçada, e o módulo tem quiz e simulado para testar o que ficou.

Treinar essa pergunta no app