FastPrepProgressive Tax Calculator
Problems/Progressive Tax Calculator

Progressive Tax Calculator

Interactive Brokers logoInteractive Brokers● EasyFULLTIMEOA

Updated Sep 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: This problem is backed by a real Interactive Brokers OA report. FastPrep reconstructed the executable prompt from the source-backed coding task: calculate tax under a sorted progressive marginal tax bracket system. Estimated match rate: 90-95% for the core task, 75-85% for exact original wording and platform-specific examples.

Implement a tax calculator for a progressive marginal tax system.

You are given two arrays of equal length:

  • lowerCutoffs[i]: the lower income cutoff for tax bracket i.
  • rates[i]: the marginal tax rate for tax bracket i, written as a decimal. For example, 0.1 means 10%.

The brackets are sorted by lowerCutoffs in increasing order, and lowerCutoffs[0] = 0.

For bracket i, the taxable range starts at lowerCutoffs[i]. If bracket i + 1 exists, the range ends at lowerCutoffs[i + 1]. Otherwise, the final bracket has no upper limit.

Given an income income, calculate the total tax owed. Each portion of income is taxed only at the marginal rate for the bracket containing that portion.

Function

calculateTax(lowerCutoffs: long[], rates: float[], income: long) → float

Examples

Example 1

lowerCutoffs = [0, 10000, 50000]rates = [0.125, 0.25, 0.5]income = 60001return = 16250.5

The first 10000 is taxed at 12.5%, the next 40000 is taxed at 25%, and the final 10001 is taxed at 50%. The total is 1250 + 10000 + 5000.5 = 16250.5.

Example 2

lowerCutoffs = [0, 100]rates = [0.125, 0.25]income = 151return = 25.25

The first 100 is taxed at 12.5%, and the remaining 51 is taxed at 25%, for 12.5 + 12.75 = 25.25.

Constraints

  • 1 <= lowerCutoffs.length = rates.length <= 10^5
  • lowerCutoffs is sorted in increasing order.
  • lowerCutoffs[0] = 0
  • 0 <= rates[i] <= 1
  • income >= 0

Similar questions at other companies

  • Basic Item DiscountsPalantir · OAPalantir interview questions
  • Diagonal Bounce TraversalAutodesk · OAAutodesk interview questions
  • Costliest ChocolateRippling · OARippling interview questions
  • Online No-Intercept Linear RegressionTwo Sigma · OATwo Sigma interview questions
  • Plus Mult ArrayIBM · OAIBM interview questions
  • 2020 Account Balance with Monthly Card FeesDRW · OADRW interview questions
  • Array Challenge (QR Intern)Akuna Capital · OAAkuna Capital interview questions
  • Latency Bucket CounterDatadog · OA · PHONE SCREENDatadog interview questions
  • First Fibonacci Number at Least the Array SumBitGo · OABitGo interview questions
  • Metro Fare With a Daily CapMicrosoft · OAMicrosoft interview questions
See Interactive Brokers hiring insights
Saved
class Solution {
    public float calculateTax(long[] lowerCutoffs, float[] rates, long income) {
      // write your code here
    }

}
Checking account…