Windowing in Kafka Streams — Concept Check
Questions on Windowing in Kafka Streams. Tumbling windows (fixed non-overlapping), hopping windows (overlapping), session windows (activity-based gaps), and sliding windows each model different time-series aggregation needs.
Questions in this quiz
7 questions on Windowing in Kafka Streams — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A developer sets up a tumbling window to count orders per product every hour. What happens if an order arrives 2 minutes after the window closes, and there is no grace period set?
- AThe order is discarded and not counted.
- BThe order is added to the next window.
- CThe order triggers an error.
- DThe order is processed with a delay.
2.In a Kafka Streams application, you want to calculate a rolling 5-minute average CPU usage updated every minute. Which window type should you use?
- ASliding window
- BSession window
- CTumbling window
- DHopping window
3.A session window is set with a 30-minute inactivity gap. User A views pages at 10:00, 10:05, and 10:25. What happens if they view another page at 11:30?
- AThe session ends at 10:25.
- BA new session starts at 11:30.
- CThe session merges with other user sessions.
- DThe session extends to 11:30.
4.In Kafka Streams, why might a sliding window be preferred for time-range joins?
- AIt handles late events better than other windows.
- BIt reduces the number of windows, saving resources.
- CIt creates windows around each event, allowing precise time-range joins.
- DIt automatically adjusts window size based on event frequency.
5.What is the primary purpose of setting a grace period in Kafka Streams windowing?
- ATo allow late events to be processed after the window closes.
- BTo extend the window duration for more data.
- CTo reduce the number of windows created.
- DTo merge overlapping windows automatically.
6.During a Kafka Streams session window, what determines when a session ends?
- AInactivity gap exceeding the defined limit.
- BEvent arrival time exceeding the grace period.
- COverlapping of multiple user sessions.
- DFixed time intervals like hourly or daily.
7.A developer mistakenly believes that tumbling windows can overlap. Which window type actually allows overlapping?
- ATumbling windows
- BHopping windows
- CSession windows
- DSliding windows