About this question
Medium · data_structures · Quant Developer interview question · fenwick-tree, bit, range-sum, prefix-sum, data_structures, vwap, volume
A Fenwick tree, or Binary Indexed Tree (BIT), is a data structure that efficiently calculates prefix sums and supports point updates in O(log n) time. In quantitative finance, it is used for high-frequency data analysis, such as computing cumulative trade volumes over tick ranges or real-time VWAP over sliding windows. This structure's performance advantage stems from its low constant factors and cache-friendly memory access patterns. Task Implement the update and prefix_sum methods for the pro