Finance splits each conversion's revenue across the channels that touched it, using a position-based model. The split has to reconcile to the penny — the credited cents for a conversion must add up to its revenue exactly, with no rounding drift anywhere in the report.
Each journey has conversion_id (int), revenue_cents (int) and channels, the touched channels in chronological order.
Return one dict per conversion and channel, with keys in this order:
conversion_id, channel, credit_cents
credit_cents are integers and must sum to revenue_cents exactly for each conversionconversion_id, then channeljourneys| channels | conversion_id | revenue_cents |
|---|---|---|
| ["email"] | 1 | 10000 |
| ["email","social"] | 2 | 10000 |
| conversion_id | channel | credit_cents |
|---|---|---|
| 1 | 10000 | |
| 2 | 5000 | |
| 2 | social | 5000 |
journeys| channels | conversion_id | revenue_cents |
|---|---|---|
| ["search","display","social","email"] | 3 | 10000 |
| conversion_id | channel | credit_cents |
|---|---|---|
| 3 | display | 1000 |
| 3 | 4000 | |
| 3 | search | 4000 |
| 3 | social | 1000 |
Community-reported interview topic. Not an official company question and no affiliation is implied.
Run against the public tests, or submit to score against all of them.