Exercício prático · Real-Time

Practice lab: Recover a disconnected client

do caderno de estudos · atualizado em 2 de outubro de 2026
Para quem vai encarar entrevista de Real-Time2 min

Tente resolver a tarefa antes de consultar os critérios. Compare o resultado e explique o que mudou no seu raciocínio.

Tarefa e critérios de verificação

Task, 15 minutes: a chat client last acknowledged message 40, disconnects, and misses messages 41 and 42. On reconnect, it receives a replay containing 41 and 42 while a live delivery also sends 42. Design the resume request and client update.

Check your work:

  • The final history contains 40, 41, and 42 once each, in the application's defined order.
  • A durable store or log supplies missed messages. Plain Redis Pub/Sub cannot replay them after the subscriber disconnects.
  • The resume cursor is scoped to an authorized conversation. Knowing another conversation's id does not grant access.
  • State what the user sees if the cursor is older than the retention window, such as a full history refresh.

Follow-up: distinguish transport reconnection, application-level replay, and deduplication. Reconnecting a socket solves only the first.

No app, a tarefa fica visível e você pode revelar os critérios depois da tentativa. Use as notas para registrar sua solução.

Praticar este exercício no app