You need array basics and cumulative computation understanding. Hash Map Patterns also helps since many prefix sum problems combine both techniques for subarray sum queries.
The key insight is that any subarray sum can be computed as the difference of two prefix sums: . Make sure you understand this relationship and can apply it before starting these problems.