nerdexam
Google

PROFESSIONAL-DATA-ENGINEER · Question #216

A data scientist has created a BigQuery ML model and asks you to create an ML pipeline to serve predictions. You have a REST API application with the requirement to serve predictions for an…

The correct answer is D. Create a Cloud Dataflow pipeline using BigQueryIO to read predictions for all users from the query. Option D is correct because serving predictions with sub-100ms latency is fundamentally incompatible with running live BigQuery queries, which typically take several seconds to execute. The right architectural pattern is to pre-compute batch predictions for all users via a…

Submitted by naveen.iyer· Mar 30, 2026Operationalizing machine learning models

Question

A data scientist has created a BigQuery ML model and asks you to create an ML pipeline to serve predictions. You have a REST API application with the requirement to serve predictions for an individual user ID with latency under 100 milliseconds. You use the following query to generate predictions: SELECT predicted_label, user_id FROM ML.PREDICT (MODEL `dataset.model', table . How should you create the ML pipeline? user_features)

Options

  • AAdd a WHERE clause to the query, and grant the BigQuery Data Viewer role to the application service account.
  • BCreate an Authorized View with the provided query.
  • CCreate a Cloud Dataflow pipeline using BigQueryIO to read results from the query.
  • DCreate a Cloud Dataflow pipeline using BigQueryIO to read predictions for all users from the query.

How the community answered

(34 responses)
  • A
    3% (1)
  • B
    6% (2)
  • C
    9% (3)
  • D
    82% (28)

Explanation

Option D is correct because serving predictions with sub-100ms latency is fundamentally incompatible with running live BigQuery queries, which typically take several seconds to execute. The right architectural pattern is to pre-compute batch predictions for all users via a Dataflow pipeline, then write those results to a low-latency store (e.g., Bigtable, Memorystore) that the REST API can query in under 100ms.

Why the distractors fail:

  • A - Adding a WHERE user_id = ? clause still triggers a live BigQuery execution per request; BigQuery has slot-based query latency measured in seconds, not milliseconds, regardless of result size.
  • B - An Authorized View is just a saved query definition; it still executes against BigQuery at read time, providing no latency improvement.
  • C - A Dataflow pipeline that reads query results reactively (on demand) still doesn't decouple prediction generation from the serving path, so latency remains bounded by the BigQuery query time.

Memory tip: Think of it as the "bake vs. fry" rule - low-latency ML serving requires baking predictions ahead of time in batch for all users (D), not frying them to order at request time (A, B, C). If the question mentions <100ms latency + BigQuery ML, the answer almost always involves pre-computed batch predictions stored in a fast-read data store.

Topics

#BigQuery ML#ML Prediction Serving#Cloud Dataflow#Low Latency Serving

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-DATA-ENGINEER Practice