hardMultiple Choice
PDE Practice Question: A manufacturing company wants to detect anomalies…
A manufacturing company wants to detect anomalies in sensor data from thousands of IoT devices in real time. The data is streaming into Pub/Sub. The best solution should use a machine learning model served from AI Platform that scores sensor readings aggregated over 5-minute windows. Which pipeline design meets these requirements?
⚠ Common exam trap
Google Cloud often tests the distinction between stream processing (Dataflow) and batch-oriented services (BigQuery scheduled queries), and the trap here is assuming that BigQuery's streaming inserts combined with scheduled queries can achieve real-time aggregation, when in fact scheduled queries introduce minutes of delay and are not window-aware for sliding time intervals.
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 Cloud Dataflow with sliding windows to aggregate sensor readings every 5 minutes, then call a trained model hosted on AI Platform Prediction for each window
Cloud Dataflow's sliding windows natively handle the 5-minute aggregation requirement for streaming data, and its ability to call external services via a DoFn allows integration with AI Platform Prediction for real-time model scoring. This design aligns with the need for low-latency, scalable processing of Pub/Sub streams without managing 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.
- ✗
Use Cloud Dataproc with Spark Streaming to aggregate data, and use a Spark ML model embedded in the pipeline
Why it's wrong here
Spark ML embedded in Dataproc bypasses the AI Platform-served model the requirements mandate, and Spark Streaming micro-batches do not natively align to 5-minute windows with endpoint calls. Dataproc fits migrating existing Spark workloads, not this design.
- ✗
Use BigQuery streaming inserts and run scheduled queries that call the ML model
Why it's wrong here
Scheduled BigQuery queries run at intervals, not continuously over 5-minute windows, and cannot invoke an AI Platform endpoint per window in real time. BigQuery suits batch analytics; streaming windowed scoring with a served model needs Dataflow.
- ✓
Use Cloud Dataflow with sliding windows to aggregate sensor readings every 5 minutes, then call a trained model hosted on AI Platform Prediction for each window
Why this is correct
Cloud Dataflow sliding windows aggregate the Pub/Sub stream into five-minute intervals, and each window is scored by calling the AI Platform Prediction endpoint. This satisfies both constraints: real-time streaming aggregation and serving the trained model rather than embedding it in the pipeline.
- ✗
Use Cloud Functions triggered by Pub/Sub to process each sensor reading individually
Why it's wrong here
Cloud Functions processes each reading individually, so no 5-minute windowed aggregation occurs and the AI Platform model never receives the grouped input it requires. It is tempting because Cloud Functions suits lightweight per-message event handling, such as filtering or enriching single Pub/Sub events, but windowed stream aggregation needs Dataflow.
Go deeper
Related to this question
About these practice questions
This PDE question is part of Courseiva's 747-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 →
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.