A prefix sum array stores sums up to each index. After O(n) preprocessing, you can answer range sum queries in O(1): sum[l..r] = prefix[r] - prefix[l-1]. It’s also used for counting frequencies and quick “how many in a range” queries.