Common mistakes when implementing BIT:
Off-by-one with 0-indexing: BIT uses 1-based indexing. Convert: position in 0-indexed array → position in BIT.
Forgetting to update the original array: For "set value" operations, compute delta first: .
Wrong loop bounds: Update loop goes up to , query loop goes down to .
Empty prefix edge case: . Handle in range queries.
Integer overflow: For large values, use 64-bit integers. Debugging: print prefix sums at each step, verify against brute force for small inputs.