Sliding windows and moving averages
Explore rolling aggregates, prefix sums and bounded windows over streaming sensor data.
View lesson accessAll lessonsWhat the lesson covers
The course lesson is called A moving average that costs nothing. The moving average adds up the last 64 samples for every new sample. Ravi shows how one addition and one subtraction do the same job.
- moving average
- sliding window
- two pointers
- prefix sums
- monotonic deque
Before you start
Question to think about: What state must persist between samples to avoid recomputing an entire window?
Preparation exercise: Define what happens before a window is full and choose a reference calculation for comparisons.
This is an original public study prompt, not the paid lesson or its solution. The interactive course contains the walkthroughs, labs, exercises and recaps.
Read the free embedded C articles for additional practice.
Test your understanding
Practice free firmware interview questions and mock interviews · Assess your readiness