Courseiva
Develop data processing →easyMultiple Choice

DP-203 Develop data processing Practice Question

You are developing a real-time data processing solution using Azure Stream Analytics. The input is an Azure Event Hubs stream with JSON data containing a 'timestamp' field. You need to output the average temperature per device every minute using a tumbling window. Which query should you use?

⚠ Common exam trap

A common mix-up: candidates confuse `SlidingWindow` or `HopWindow` with `TumblingWindow`, not realizing that only `TumblingWindow` produces non-overlapping, fixed-interval outputs required for a simple per-minute average.

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

✓

SELECT DeviceId, AVG(Temperature) AS AvgTemp FROM Input TIMESTAMP BY Timestamp GROUP BY DeviceId, TumblingWindow(minute, 1)

A tumbling window is a fixed, non-overlapping time window that groups events into distinct time segments. Using `TumblingWindow(minute, 1)` with `TIMESTAMP BY Timestamp` ensures that the average temperature per device is computed over each one-minute interval without overlap, which matches the requirement of 'every minute'.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    SELECT DeviceId, AVG(Temperature) AS AvgTemp FROM Input TIMESTAMP BY Timestamp GROUP BY DeviceId, SlidingWindow(minute, 1)

    Why it's wrong here

    SlidingWindow emits output whenever an event enters or leaves the window, giving event-driven, overlapping results rather than one output per fixed minute. TumblingWindow is needed for discrete, non-overlapping minute buckets. SlidingWindow suits continuous threshold monitoring, not periodic per-minute averages.

  • ✓

    SELECT DeviceId, AVG(Temperature) AS AvgTemp FROM Input TIMESTAMP BY Timestamp GROUP BY DeviceId, TumblingWindow(minute, 1)

    Why this is correct

    TumblingWindow(minute, 1) produces fixed, non-overlapping one-minute windows, satisfying the per-minute aggregation requirement, while TIMESTAMP BY Timestamp makes Stream Analytics use the event's own timestamp rather than arrival time. Grouping by DeviceId alongside the window yields one average temperature per device per minute, exactly as specified.

  • ✗

    SELECT DeviceId, AVG(Temperature) AS AvgTemp FROM Input TIMESTAMP BY Timestamp GROUP BY DeviceId, SessionWindow(minute, 1, 1)

    Why it's wrong here

    SessionWindow groups events into sessions separated by inactivity gaps, producing variable, non-aligned intervals rather than fixed one-minute blocks. TumblingWindow is required for contiguous, non-overlapping minute buckets. SessionWindow suits activity-based grouping, such as user sessions with idle timeouts.

  • ✗

    SELECT DeviceId, AVG(Temperature) AS AvgTemp FROM Input TIMESTAMP BY Timestamp GROUP BY DeviceId, HopWindow(minute, 1, 1)

    Why it's wrong here

    HopWindow produces overlapping windows, so each event can appear in several one-minute outputs, duplicating results. TumblingWindow gives non-overlapping, fixed one-minute intervals. HopWindow would be correct for sliding or rolling aggregates where overlapping periods are intended.

About these practice questions

One of 509 original DP-203 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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DP-203 practice question is part of Courseiva's free Microsoft 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 DP-203 exam.