Courseiva
mediumMultiple ChoiceObjective-mapped

PDE Practice Question: Using Dataflow to stream data from Cloud Pub/Sub…

A company is using Dataflow to stream data from Cloud Pub/Sub to BigQuery. The pipeline includes a custom ParDo transformation that enriches the data with external API calls. The pipeline is experiencing high latency and occasional failures due to API timeouts. What strategy should be employed to improve reliability and performance?

⚠ Common exam trap

Google Cloud often tests the misconception that scaling workers (Option D) is a universal fix for performance issues, but the trap here is that API timeouts are often caused by the external service's capacity, not the pipeline's parallelism, and stateful batching with async calls is the correct architectural pattern.

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

Use a DoFn with stateful processing and batch API calls using asynchronous HTTP client.

Using a DoFn with stateful processing and an asynchronous HTTP client allows the pipeline to batch API calls and handle timeouts without blocking the main processing thread. This reduces latency by enabling concurrent requests and improves reliability through retry logic and state management, which is essential for external API enrichment in Dataflow.

Answer analysis

Option-by-option breakdown

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

  • Remove the enrichment step and store raw data in BigQuery.

    Why it's wrong here

    This loses required data enrichment.

  • Use a global window to accumulate all data before enrichment.

    Why it's wrong here

    Global window is inappropriate for streaming and introduces unbounded delay.

  • Use a DoFn with stateful processing and batch API calls using asynchronous HTTP client.

    Why this is correct

    Batching and async calls reduce per-element latency and handle timeouts gracefully.

  • Increase the number of workers to parallelize API calls.

    Why it's wrong here

    This may increase load on the API but does not address timeouts.

About these practice questions

Courseiva writes every PDE question from scratch — 890 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.