Amazon's analytics pipelines frequently compute rolling sums over subarrays. The prefix sum + hash map trick converts a nested loop into a single pass, and this problem is the textbook example. You accumulate a running sum and check whether runningSum - k has appeared before.
Solve it on LeetCode, then check your approach in the full walkthrough. This gives you time and space.