PDE Designing Data Processing Systems Practice Question
A company uses Cloud Pub/Sub to ingest events from multiple sources. They need to guarantee that each event is processed exactly once by downstream consumers. However, Pub/Sub guarantees at-least-once delivery. Which additional steps should they implement to achieve exactly-once processing?
⚠ Common exam trap
PDE often tests the misconception that enabling a Pub/Sub feature (like deduplication or dead letter topics) can achieve exactly-once processing, when in fact exactly-once requires application-level idempotency.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Store each message's unique ID in a database and ignore duplicates.
Pub/Sub's at-least-once delivery means a message can be redelivered if the ack isn't received in time or if the subscriber crashes after processing but before acking. To achieve exactly-once processing, the consumer must implement idempotency by tracking processed message IDs and discarding duplicates. Storing each message's unique ID in a database and ignoring duplicates ensures that even if the same message is delivered multiple times, it is only processed once. This is the standard pattern for exactly-once semantics on top of at-least-once infrastructure.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Set the subscription's acknowledgment deadline to 0.
Why it's wrong here
An acknowledgment deadline of 0 seconds causes messages to be redelivered immediately, multiplying duplicates rather than preventing them. Exactly-once requires consumer-side idempotency or Pub/Sub's exactly-once delivery subscription setting. A short deadline suits fast-failing handlers that need rapid retry, not duplicate suppression.
- ✗
Enable message deduplication on the subscription.
Why it's wrong here
Pub/Sub deduplication applies only to messages carrying the same message ID within the ten-minute window, and only on publish; it cannot deduplicate distinct publishes of identical event content. Consumers must implement idempotent processing. Subscription deduplication suits publisher retries of an identical message, not downstream exactly-once guarantees.
- ✓
Store each message's unique ID in a database and ignore duplicates.
Why this is correct
Pub/Sub delivers at-least-once, so the same message can arrive repeatedly. Persisting each message's unique ID and discarding already-seen IDs gives idempotent deduplication at the consumer, converting at-least-once delivery into effectively exactly-once processing as the stem requires.
- ✗
Use a dead letter topic to capture duplicates.
Why it's wrong here
A dead letter topic only diverts messages that repeatedly fail delivery, so duplicates already processed successfully still reach consumers. Deduplication must occur in the consumer, using message IDs or idempotent writes. Dead lettering is correct when isolating poison messages after a retry limit.
Go deeper
Related to this question
About these practice questions
One of 747 original PDE practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Google Cloud exam blueprint
This PDE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PDE exam.