Courseiva
Question 338 of 964
Integrating Google Cloud serviceshardMultiple SelectObjective-mapped

PCD Integrating Google Cloud services Practice Question

You are designing a serverless application using Cloud Functions that processes events from Cloud Storage and Cloud Pub/Sub. The function must be idempotent and handle duplicate events. Which three best practices should you implement? (Choose THREE.)

⚠ Common exam trap

Many exam-takers confuse timeout settings or synchronous invocation with duplicate prevention, but neither addresses the root cause of duplicate events from at-least-once delivery systems. In Google Cloud, Cloud Functions may receive duplicate events from Cloud Storage notifications or Pub/Sub, making idempotency keys and state tracking essential.

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

Generate a unique idempotency key for each event and store processed keys in a database.

Generating a unique idempotency key for each event and storing processed keys in a database (such as Cloud Firestore) ensures that if the same event is delivered multiple times (e.g., due to at-least-once delivery semantics in Cloud Pub/Sub or Cloud Storage notifications), the function can check the key before processing and skip duplicates. This pattern is essential for idempotent serverless functions, as Cloud Functions may be retried on failure or receive duplicate events from the source.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Generate a unique idempotency key for each event and store processed keys in a database.

    Why this is correct

    Idempotency keys prevent duplicate processing.

  • Invoke the function synchronously to avoid duplicates.

    Why it's wrong here

    Synchronous invocation is not supported for background functions.

  • Implement a deduplication logic that checks the event's publish time against a threshold.

    Why this is correct

    Timestamps can help filter duplicates.

  • Use Cloud Firestore to record the state of each processed event.

    Why this is correct

    Transactional state helps idempotency.

  • Set the function timeout to maximum (540 seconds) to ensure processing completes.

    Why it's wrong here

    Timeout does not prevent duplicates.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This PCD 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 PCD exam.