How Should You Window Streaming Noise Data in Dataflow?
You are building a streaming Dataflow pipeline that ingests noise level data from hundreds of sensors placed near construction sites across a city. The sensors measure noise level every ten seconds, and send that data to the pipeline when levels reach above 70 dBA. You need to detect the average noise level from a sensor when data is received for a duration of more than 30 minutes, but the window ends when no data has been received for 15 minutes. What should you do?
Community Votes
79% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
The test probes whether you recognize that a 'gap after no data' defines a session window, not fixed or hopping windows; the 30-minute requirement is a filter, not a window size.
For a streaming Dataflow pipeline that must group sporadic sensor events into sessions, session windows with a 15-minute gap duration are the correct choice. Community consensus strongly favors Option A, with 69 votes for session windows.
Choosing hopping windows (Option C) — 18% of voters — because it misinterprets the 15-minute gap as a fixed window period rather than an inactivity threshold.
Community Discussion (17 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
Session windows are the only window type that automatically closes when a configured gap duration of inactivity elapses. With a 15-minute gap, the pipeline groups all events from a sensor until 15 minutes pass without new data, exactly matching the 'no data for 15 minutes' ending condition. The 'more than 30 minutes' requirement is met by filtering the resulting sessions to those whose total duration exceeds 30 minutes; this is a common pattern in Dataflow and does not require changing the window function. Comments [1] and [2] correctly explain that sporadic sensor data fits session windows because the window stays open as long as data arrives and closes only after the gap.
Why the Other Options Are Wrong
Option B uses a 30-minute gap, which is double the required inactivity period and would keep windows open too long. Option C uses hopping windows, which are fixed-time windows that overlap periodically; they cannot detect data-driven gaps and would not properly group events into activity bursts. Option D uses tumbling 15-minute windows; these are aligned to the clock, not to the data, and the allowed lateness parameter does not address the gap-based ending condition. Commenter [8] incorrectly suggests B, and [9]/[10] incorrectly suggest D, but all ignore the explicit 'no data has been received for 15 minutes' clause.
Community Comment Notes
The community strongly agrees on A, with 69 votes versus only 18 for C. Comments [4] and [5] cite official documentation for Dataflow session windows and Apache Beam's Sessions class, reinforcing that this is the intended solution. Commenter [1] provides a clear rationale about sporadic sensor data, while [2] succinctly outlines why hopping and tumbling windows are ruled out. The few dissenting comments (B and D) fail to account for the 15-minute inactivity gap, which is the key determinant for session windows.
Official Reference
Exam Strategy
When a question specifies 'ends when no data has been received for X minutes,' immediately think session windows with a gap duration of X. Apply the other duration (e.g., 30 minutes) as a filter on the session result, not as the window size.