Card Launch Unit Economics Report Builder
Math & Bit ManipulationAuto-graded · 13 test casesLast updated
Build a fixed unit-economics report for a card launch: portfolio P&L, partnership uplift, bonus payback time, and the zero-profit loss rate.
A bank is modelling the first-year economics of a new credit card. Write a function that takes no arguments and returns a single dictionary summarising the model. All figures come from the assumptions below.
Assumptions
Customer segments
| Segment | Population | Share who become cardholders | Annual spend per cardholder |
|---|---|---|---|
| A | 30,000 | 20% | $100,000 |
| B | any | 0% | not counted |
| C | 150,000 | 5% | $20,000 |
Economics
- Revenue is 3% of total cardholder spend (
0.03). - Credit losses cost 1% of total cardholder spend (
0.01). - Acquisition costs $200 per cardholder, paid once.
- Fixed costs are $10,000,000 per year.
- The bank's annual profit is revenue, minus credit losses, minus acquisition cost, minus fixed cost. The $200 acquisition cost is charged in the year being modelled.
Partnership
A partnership adds 5,000 extra cardholders. Each one spends $40,000 per year. Fixed costs stay the same.
Signup bonus
Each partnership cardholder receives a $500 bonus. To find the payback time of this incremental $500, assume:
- Spend accrues evenly through the year.
- The customer is retained indefinitely.
- There is no discounting.
- The yearly net margin per customer is
40000 * (0.03 - 0.01).
The payback time is 500 divided by that margin, in years, rounded to 2 decimals.
Required return value
Return a dictionary with exactly these keys.
"base_portfolio": a dictionary describing the portfolio without the partnership, with keys:"annual_spend": total spend of all cardholders."gross_revenue": spend × 0.03."default_cost": spend × 0.01."acquisition_cost": number of cardholders × 200."fixed_cost": 10,000,000."profit":gross_revenue - default_cost - acquisition_cost - fixed_cost.
"additional_costs": a list of exactly two dictionaries, in this order, each with keys"cost"and"profit_effect":{"cost": "Rewards or cashback", "profit_effect": "reduces profit by the reward expense"}{"cost": "Customer servicing", "profit_effect": "reduces profit by servicing expense"}
"with_partnership": a dictionary with the same six keys as"base_portfolio", computed for the base cardholders plus the 5,000 partnership cardholders. The signup bonus is not included here."partnership_incremental_profit": profit with the partnership minus base profit."signup_bonus_breakeven": a dictionary with keys:"formula": the exact string"cumulative net profit(t) = -500 + 40000 * (0.03 - 0.01) * t"."breakeven_years": the payback time described above, rounded to 2 decimals."before_breakeven": the string"negative"."at_breakeven": the integer0."after_breakeven": the string"positive".
"zero_profit_default_rate_base_portfolio": the credit-loss raterat which the base portfolio's profit is exactly zero. Keep the revenue rate, acquisition cost, and fixed cost as given, and use the base portfolio's cardholder count and spend."zero_profit_default_rate_formula": the exact string"r = revenue_rate - (acquisition_cost * active_cards + fixed_cost) / annual_spend".
Constraints
- The function takes no parameters.
- All numeric inputs are the fixed values given above.
- Cardholders per segment are population × share. The 0% segment contributes nothing.
- Dictionary keys and string values must match the spelling above exactly.
- Money values are in dollars. Do not round anything except
"breakeven_years".
Examples
Example 1
Input: build_card_launch_report()
Output: {'base_portfolio': {'annual_spend': 750000000, 'gross_revenue': 22500000, 'default_cost': 7500000, 'acquisition_cost': 2700000, 'fixed_cost': 10000000, 'profit': 2300000}, 'additional_costs': [{'cost': 'Rewards or cashback', 'profit_effect': 'reduces profit by the reward expense'}, {'cost': 'Customer servicing', 'profit_effect': 'reduces profit by servicing expense'}], 'with_partnership': {'annual_spend': 950000000, 'gross_revenue': 28500000, 'default_cost': 9500000, 'acquisition_cost': 3700000, 'fixed_cost': 10000000, 'profit': 5300000}, 'partnership_incremental_profit': 3000000, 'signup_bonus_breakeven': {'formula': 'cumulative net profit(t) = -500 + 40000 * (0.03 - 0.01) * t', 'breakeven_years': 0.63, 'before_breakeven': 'negative', 'at_breakeven': 0, 'after_breakeven': 'positive'}, 'zero_profit_default_rate_base_portfolio': 0.013066666666666664, 'zero_profit_default_rate_formula': 'r = revenue_rate - (acquisition_cost * active_cards + fixed_cost) / annual_spend'}
Hints
Hint 1
Start with the cardholder counts (population times share) for segments A and C, then total spend as cards times spend per card. Segment B contributes nothing.
Hint 2
Write one small helper that turns (total spend, total cards) into the six-key P&L dictionary, and call it once for the base portfolio and once for the expanded one.
Hint 3
Setting profit to zero gives r = revenue_rate - (acquisition_cost * cards + fixed_cost) / spend. The bonus payback is 500 divided by the yearly net margin per partnership customer, which is 40000 * (0.03 - 0.01).
Worked solution
Easy Try it yourself first — then compare your approach, complexity and edge cases.
Approach
This is a direct calculation. The work is in modelling the quantities correctly and assembling the output.
-
Cardholders and spend. Segment A gives 30,000 × 20% = 6,000 cards at $100,000 each, which is $600M. Segment C gives 150,000 × 5% = 7,500 cards at $20,000 each, which is $150M. Segment B contributes nothing. The totals are 13,500 cards and $750M of spend.
-
P&L helper. For any (spend, cards) pair:
- revenue = 3% of spend
- credit losses = 1% of spend
- acquisition = $200 × cards
- profit = revenue − losses − acquisition − $10M fixed
For the base book this gives 22.5M − 7.5M − 2.7M − 10M = $2.3M.
-
Partnership. Adding 5,000 cards and $200M of spend gives 18,500 cards and $950M of spend. Profit is 28.5M − 9.5M − 3.7M − 10M = $5.3M. The incremental profit is therefore $3.0M. This equals 2% × $200M minus 5,000 × $200, since fixed costs do not change.
-
Bonus payback. Each partnership customer nets 40,000 × (0.03 − 0.01) = $800 per year. Spend accrues evenly, so cumulative contribution is $800·t. The incremental $500 is recovered at t = 500 / 800 = 0.625, which rounds to 0.63 years.
-
Zero-profit loss rate. Setting p·S − r·S − a·N − F = 0 gives r = p − (a·N + F) / S. For the base book this is 0.03 − 12.7M / 750M ≈ 0.013067.
-
Output. Assemble the dictionary with the exact keys and fixed strings from the statement.
Why it is correct
Every output is an algebraic consequence of the stated assumptions. Acquisition cost is charged once in the modelled year. The same helper builds both portfolios, so the base and expanded P&L dictionaries are consistent, and the incremental profit is simply their difference. The breakeven rate is the exact inverse of the profit equation with respect to the loss rate.
Complexity
Time is O(1) and space is O(1), since only a fixed number of arithmetic operations and a fixed-size dictionary are involved.
Reference solution
from typing import Dict
def build_card_launch_report() -> Dict[str, object]:
revenue_rate = 0.03
default_rate = 0.01
acquisition_cost = 200
fixed_cost = 10_000_000
seg_a_cards = 30_000 * 0.20
seg_c_cards = 150_000 * 0.05
base_cards = seg_a_cards + seg_c_cards
base_spend = seg_a_cards * 100_000 + seg_c_cards * 20_000
def pnl(spend, cards):
revenue = spend * revenue_rate
losses = spend * default_rate
acquisition = cards * acquisition_cost
profit = revenue - losses - acquisition - fixed_cost
return {
"annual_spend": spend,
"gross_revenue": revenue,
"default_cost": losses,
"acquisition_cost": acquisition,
"fixed_cost": fixed_cost,
"profit": profit,
}
partner_cards = 5_000
partner_spend = partner_cards * 40_000
base = pnl(base_spend, base_cards)
expanded = pnl(base_spend + partner_spend, base_cards + partner_cards)
yearly_margin = 40_000 * (revenue_rate - default_rate)
payback_years = 500 / yearly_margin
breakeven = {
"formula": "cumulative net profit(t) = -500 + 40000 * (0.03 - 0.01) * t",
"breakeven_years": round(payback_years, 2),
"before_breakeven": "negative",
"at_breakeven": 0,
"after_breakeven": "positive",
}
zero_profit_rate = revenue_rate - (base_cards * acquisition_cost + fixed_cost) / base_spend
return {
"base_portfolio": base,
"additional_costs": [
{"cost": "Rewards or cashback", "profit_effect": "reduces profit by the reward expense"},
{"cost": "Customer servicing", "profit_effect": "reduces profit by servicing expense"},
],
"with_partnership": expanded,
"partnership_incremental_profit": expanded["profit"] - base["profit"],
"signup_bonus_breakeven": breakeven,
"zero_profit_default_rate_base_portfolio": zero_profit_rate,
"zero_profit_default_rate_formula": "r = revenue_rate - (acquisition_cost * active_cards + fixed_cost) / annual_spend",
}