mediumMultiple Choice
PMLE Practice Question: Perform sentiment analysis on streaming social…
A company needs to perform sentiment analysis on streaming social media data. Which architecture should they use?
⚠ Common exam trap
Google Cloud often tests the misconception that Cloud Functions can replace Dataflow for streaming pipelines, but Cloud Functions lacks stream processing primitives (e.g., windowing, state management) and has a 9-minute timeout, making it unsuitable for continuous sentiment analysis.
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
✓
Pub/Sub → Dataflow → Natural Language API → BigQuery
Streaming social media data requires a scalable, ordered ingestion pipeline. Pub/Sub ingests the stream, Dataflow processes it in real-time (e.g., windowing, deduplication), the Natural Language API performs sentiment analysis, and BigQuery stores results for querying. This decouples ingestion from processing and storage, enabling exactly-once semantics and auto-scaling.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Dataflow → Pub/Sub → Natural Language API → BigQuery
Why it's wrong here
Dataflow cannot precede Pub/Sub, since it reads from the topic rather than feeding it; the pipeline would have no input source. Dataflow is correct for transforming and windowing streams after ingestion. The architecture must begin with Pub/Sub receiving the social media feed.
- ✗
Pub/Sub → Cloud Functions → Natural Language API → Cloud Storage
Why it's wrong here
Cloud Functions cannot acknowledge Pub/Sub messages while awaiting the Natural Language API, so unacknowledged messages redeliver and duplicate calls. Pub/Sub with Cloud Functions suits lightweight event handling, not sustained streaming analysis; Dataflow provides the windowing and backpressure this pipeline needs.
- ✗
Cloud Functions → Pub/Sub → Natural Language API → BigQuery
Why it's wrong here
Placing Cloud Functions before Pub/Sub inverts the flow: functions must be invoked by an event source, so they cannot publish incoming social media data into the topic. This ordering suits synchronous request handling. Streaming ingestion requires Pub/Sub first, then Dataflow for windowed processing.
- ✓
Pub/Sub → Dataflow → Natural Language API → BigQuery
Why this is correct
Pub/Sub ingests the continuous social media stream, Dataflow applies windowed processing for real-time sentiment scoring, and the Natural Language API performs the sentiment analysis itself. BigQuery then stores results for querying. This satisfies the streaming requirement, which batch pipelines such as Cloud Storage-triggered jobs cannot meet.
Go deeper
Related to this question
About these practice questions
One of 775 original PMLE practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
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.