Katkat

Calculate Tax in a Progressive Marginal Tax System

Interactive BrokersSoftware Engineer · Online Assessment

Last updated

Practice a Interactive Brokers coding interview problem focused on calculate tax in a progressive marginal tax system. The prompt emphasizes edge cases, clean implementation, and verifiable test behavior without revealing the solution.

Implement a progressive marginal tax calculator. Brackets are sorted (lower_cutoff, rate) pairs. Each portion of income is taxed at the rate for its bracket until the next cutoff.

Implement:

def calculate_progressive_tax(brackets: list[tuple[float, float]], income: float) -> float:
 pass