An Eventstream aggregates turnstile-tap events into a visitor count for each museum branch, and the requirement is that every tap belongs to exactly one, non-overlapping ten-minute reporting bucket with no gaps and no double-counting across buckets. Which windowing function satisfies this requirement?
Select an answer to reveal the explanation.
Short Explanation
A tumbling window is like a row of side-by-side boxes with no space between them: every event drops into exactly one box, the boxes never overlap, and together they cover the whole timeline. Ten-minute buckets with zero double-counting is the textbook tumbling-window job.
Full Explanation
A tumbling window divides the timeline into fixed-size, contiguous, non-overlapping segments — each event is assigned to exactly one window, and consecutive windows share no time range. A ten-minute tumbling window therefore guarantees every turnstile tap lands in precisely one ten-minute bucket with complete, gap-free coverage across the day, matching the requirement exactly.
A session window is defined by a gap of inactivity rather than a fixed duration, so its boundaries move with the data — busy periods produce long sessions and quiet periods produce short ones, which does not give fixed ten-minute buckets. A hopping window with a ten-minute duration and a five-minute hop deliberately overlaps: each event can be counted in two separate windows, which directly violates the no-double-counting requirement. A sliding window re-evaluates continuously as events arrive, emitting a new result on every event rather than at fixed ten-minute boundaries, so it does not produce the clean, discrete buckets the requirement calls for.
A caveat: because tumbling windows never overlap, a burst of taps that straddles a boundary is always split across two buckets even if the taps are seconds apart, which analysts should account for when reading burst activity near a boundary. Operationally, confirm correctness by checking that the sum of all ten-minute bucket counts for a branch over a day equals the total raw tap count for that branch.