Available question text
Given an array of periodic cash flows and a fixed discount rate, answer multiple queries asking for the net present value of a subarray (the discounted sum of its cash flows using powers of 1+rate). The key is to precompute discount-factor powers and prefix-weighted sums so each query reduces to O(1) arithmetic.
Related questions
Continue with questions that share topics or the same question type.
- Block Placement Queries
Coding · Array · Binary Indexed Tree · Binary Search
- Closest Equal Element Queries
Coding
- Closest Nodes Queries in a Binary Search Tree
Coding
- Cycle Length Queries in a Tree
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1421. NPV Queries
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source