Quick Overview

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.

Calculate Tax in a Progressive Marginal Tax System

Company: Interactive Brokers

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Online Assessment

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: ```python def calculate_progressive_tax(brackets: list[tuple[float, float]], income: float) -> float: pass ```

Overview: 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.

Read the full Interactive Brokers Software Engineer interview experience this question came from

Calculate total tax owed under sorted marginal tax brackets.

Examples

Input: {"brackets":[[0,0.1],[10000,0.2],[50000,0.3]],"income":60000}

Expected Output: 12000.0

Explanation: Progressive sample.

Input: {"brackets":[[0,0.1]],"income":100}

Expected Output: 10.0

Explanation: One bracket.

Loading coding console...