KatInterview

Calculate Credit Card Portfolio Metrics and Partnership Break-Even

Math & Bit ManipulationAuto-graded · 18 test cases
EasyAuto-gradedMath & Bit Manipulationmathfinancial-modelingarithmetic

Last updated

Computes the annual net contribution per card, overall portfolio profit, and the minimum number of new accounts needed to cover a marketing campaign.

Given the unit economics of a credit card product and the cost of an optional marketing program, calculate key annual metrics and the break-even volume required to justify the acquisition campaign.

You are given six financial inputs:

  • active_cards: The current size of the active cardholder portfolio.
  • monthly_swipe_revenue: Monthly transaction revenue per card.
  • annual_membership_fee: Annual fee billed once per card.
  • monthly_interest_revenue: Monthly interest income earned per card.
  • monthly_fraud_cost: Monthly fraud prevention and chargeback costs per card.
  • campaign_cost: Total annual fixed expenditure for a proposed co-marketing partner campaign.

Calculate and return a dictionary with the following keys:

  1. "annual_contribution_per_card": The total annual net dollar contribution of a single cardholder. This is computed as: $$\text{Annual Contribution} = 12 \times \text{swipe} + \text{annual fee} + 12 \times \text{interest} - 12 \times \text{fraud cost}$$
  2. "annual_profit": The current total annual contribution from the active card base: $$\text{Annual Profit} = \text{active_cards} \times \text{annual_contribution_per_card}$$
  3. "break_even_incremental_cardholders": The minimum integer number of new full-year cardholders needed to cover the campaign_cost.
    • If campaign_cost is $0$, return $0$.
    • If annual_contribution_per_card is less than or equal to $0$ and campaign_cost $> 0$, return $-1$ (as break-even is impossible).
    • Otherwise, compute $\lceil \frac{\text{campaign_cost}}{\text{annual_contribution_per_card}} \rceil$.

Constraints

  • $1 \le \text{active_cards} \le 10^7$
  • $0 \le \text{monthly_swipe_revenue} \le 1000$
  • $0 \le \text{annual_membership_fee} \le 1000$
  • $0 \le \text{monthly_interest_revenue} \le 1000$
  • $0 \le \text{monthly_fraud_cost} \le 1000$
  • $0 \le \text{campaign_cost} \le 10^9$
  • Output must be a dictionary with integer values matching the three specified keys.

Examples

Example 1

Input: calculate_campaign_profitability(500000, 2, 79, 15, 5, 25000000)

Output: {'annual_contribution_per_card': 223, 'annual_profit': 111500000, 'break_even_incremental_cardholders': 112108}

Example 2

Input: calculate_campaign_profitability(100000, 3, 50, 10, 4, 10000000)

Output: {'annual_contribution_per_card': 158, 'annual_profit': 15800000, 'break_even_incremental_cardholders': 63292}

Example 3

Input: calculate_campaign_profitability(1, 0, 0, 0, 0, 1)

Output: {'annual_contribution_per_card': 0, 'annual_profit': 0, 'break_even_incremental_cardholders': -1}

Hints

Hint 1

Annualize monthly metrics by multiplying by 12 before combining with annual terms.

Hint 2

Make sure to subtract fraud costs while adding revenue components.

Hint 3

Round up the ratio of campaign cost to contribution per card using math.ceil to find the integer break-even volume.