Calculate Tax in a Progressive Marginal Tax System
Interactive BrokersSoftware Engineer · Online AssessmentLast 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
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.