nerdexam
Microsoft

DP-300 · Question #141

Hotspot Question You are building an Azure Stream Analytics job to retrieve game data. You need to ensure that the job returns the highest scoring record for each five-minute time interval of each…

The correct answer is SELECT: TopOne() OVER(PARTITION BY Game ORDER BY Score Desc); GROUP BY: Tumbling(minute, 5). This question tests knowledge of Azure Stream Analytics windowing functions and aggregation to find the highest scoring record per game within fixed five-minute intervals.

Submitted by joshua94· Mar 6, 2026Optimize query performance

Question

Hotspot Question You are building an Azure Stream Analytics job to retrieve game data. You need to ensure that the job returns the highest scoring record for each five-minute time interval of each game. How should you complete the Stream Analytics query? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point. Answer:

Exhibit

DP-300 question #141 exhibit

Answer Area

  • SELECTTopOne() OVER(PARTITION BY Game ORDER BY Score Desc)
    Collect(Score)CollectTop(1)OVER(ORDER BY Score Desc)Game, MAX(Score)TopOne() OVER(PARTITION BY Game ORDER BY Score Desc)
  • GROUP BYTumbling(minute, 5)
    GameHopping(minute, 5)Tumbling(minute, 5)Windows(TumblingWindow(minute, 5), Hopping(minute, 5))

Explanation

This question tests knowledge of Azure Stream Analytics windowing functions and aggregation to find the highest scoring record per game within fixed five-minute intervals.

Approach. The correct query uses a TUMBLING WINDOW of 5 minutes (TUMBLING WINDOW(minute, 5)) to define fixed, non-overlapping time intervals. To retrieve the highest score per game per window, you use MAX(score) along with GROUP BY Game, TumblingWindow(minute, 5). The full structure would be: SELECT Game, MAX(Score) AS Score, System.Timestamp() AS WindowEnd FROM [input] GROUP BY Game, TumblingWindow(minute, 5). Tumbling windows are the correct choice here because they partition time into distinct, equal-sized, non-overlapping segments - perfect for 'each five-minute interval' requirements.

Concept tested. Azure Stream Analytics windowing functions - specifically Tumbling Windows for fixed-interval aggregation combined with MAX() aggregation function and GROUP BY to partition results by game and time window.

Reference. https://docs.microsoft.com/en-us/azure/stream-analytics/stream-analytics-window-functions

Topics

#Azure Stream Analytics#window functions#Tumbling Window#TOPONE#real-time analytics

Community Discussion

No community discussion yet for this question.

Full DP-300 Practice