Courseiva
mediumMultiple Choice

PMLE Practice Question: A data-processing pipeline using Dataflow needs…

A data-processing pipeline using Dataflow needs to incorporate a custom ML prediction step. The team wants to maintain fast processing and minimize latency. What is the optimal approach?

⚠ Common exam trap

Google Cloud often tests the misconception that adding external services like Cloud Functions or Pub/Sub improves modularity without considering the latency penalty, leading candidates to choose options that introduce unnecessary hops instead of keeping prediction inline within the Dataflow pipeline.

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 custom ParDo transform in Dataflow that calls Vertex AI Prediction API directly

Using a custom ParDo transform in Dataflow allows the pipeline to call the Vertex AI Prediction API synchronously within each worker, avoiding the overhead of external triggers, intermediate storage, or asynchronous messaging. This keeps the data in-memory and minimizes latency by processing predictions inline with the Dataflow streaming or batch pipeline.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Write the data to Cloud Storage, trigger a Cloud Function to call the model, and write results back

    Why it's wrong here

    Writing to Cloud Storage and invoking a Cloud Function per batch adds serialisation and cold-start latency between pipeline stages, breaking streaming throughput. Cloud Functions suit event-driven glue tasks, not per-element inference inside a Dataflow pipeline, where a DoFn calling the model endpoint keeps processing in-stream.

  • ✓

    Use a custom ParDo transform in Dataflow that calls Vertex AI Prediction API directly

    Why this is correct

    A custom ParDo transform runs the prediction call inside the Dataflow worker pipeline, streaming each element to the Vertex AI Prediction API without an intermediate storage hop. This preserves fast processing and minimises latency, satisfying the low-latency constraint better than batch export-and-reimport patterns.

  • ✗

    Send data to a Pub/Sub topic and have a separate subscriber that runs predictions

    Why it's wrong here

    Sending data to Pub/Sub decouples the prediction step into an asynchronous subscriber, which introduces a queuing delay and breaks the pipeline’s synchronous flow. This fails the requirement for minimising latency because the subscriber must poll or receive messages, adding unpredictable wait time. The approach is tempting because Pub/Sub excels at buffering bursty workloads or decoupling services for resilience, making it correct when asynchronous processing and fault tolerance are the primary goals.

  • ✗

    Stream data through Cloud Functions that serve predictions and write to BigQuery

    Why it's wrong here

    Routing every record through Cloud Functions introduces per-invocation overhead and concurrency ceilings, so throughput collapses and latency rises. Cloud Functions serve lightweight event handlers, not sustained high-volume inference; a Dataflow DoFn invoking the model endpoint keeps prediction inside the pipeline.

About these practice questions

This PMLE question is part of Courseiva's 775-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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 PMLE 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 PMLE exam.