Revenue-Aware Financial Offer Ranking

Medium · ML System Design · Machine Learning Engineer · Onsite

Prompt

Design an end-to-end revenue-optimizing ranking system for a consumer finance marketplace that matches members with credit cards and loans. Partner lenders pay varying commissions per product, and payouts materialize only after a user progresses through a multi-stage journey (click -> application -> approval -> funding) that can take days or weeks to settle. Your system must grow platform commission revenue without sacrificing offer relevance or long-term member trust.

Base your design on these operating constraints:

  • Scale: Roughly 100,000 daily active users (DAU) backed by millions of historical interaction records.
  • Latency: Online ranking must finish in under 100 ms.
  • Funnel dynamics: Top-of-funnel clicks are relatively frequent, whereas downstream loan fundings and card activations are sparse and heavily delayed.

Scope & Expectations

  • End-to-end ML system: Feature collection, offline training pipelines, and sub-100 ms online prediction serving.
  • Funnel sparsity and delayed outcomes: Modeling multi-step conversion probabilities accurately when final funding events are rare and arrive weeks after an impression.
  • Objective formulation and cold start: Combining conversion likelihood, partner commission terms, and user-trust guardrails into a single ranking score, while onboarding newly launched offers and first-time users.
  • Drift and revenue observability: Detecting degradation in stage-level conversion rates and realized revenue well before multi-week funding windows close.

Step-by-step walkthrough

  1. Clarify requirements and decompose the conversion funnel

    A financial marketplace earns a partner commission only when a user completes a multi-step journey—often weeks after seeing an offer—and the loan is funded or the credit card is activated. That business model creates a core tension: maximizing immediate commission revenue vs. preserving user relevance and trust. Recommending high-commission cards with low approval odds triggers hard credit inquiries (official credit-bureau checks that temporarily lower a user's credit score) and painful rejections, causing users to churn permanently.

    Functional requirements

    • Rank eligible financial offers (credit cards, personal loans, auto refinancing) for a user visiting a placement (home feed, category page, email slot).
    • Model the entire conversion funnel (impression -> click -> application -> approval -> funding) and incorporate partner-specific commission structures.
    • Handle cold start from day one for newly launched financial products and brand-new users.
    • Allow product and business teams to tune the revenue-vs-relevance balance immediately without retraining ML models.

    Non-functional requirements

    • Latency: End-to-end p99 ranking latency strictly under 100 ms.
    • Auditability & compliance: Every served ranking (features, model version, predicted probabilities, policy weights) must be reproducible for fair-lending audits.
    • Hard guardrails: Deterministic rules (state licensing, minimum credit band, partner daily caps) can never be overridden by high payouts.

    Decomposing the ML problem. Rather than treating "funded conversion" as a single yes/no label, we factor it into four sequential conditional probabilities plus contract revenue:

    Stage   Conditional probability       Who controls the outcome     Typical feedback delay
    t1      P(click   | impression)       User interest                Seconds
    t2      P(apply   | click)            User intent & form friction  Minutes to ~2 days
    t3      P(approve | apply)            Partner bank underwriting    Seconds to ~10 days
    t4      P(fund    | approve)          User + bank disbursement     Days to ~40 days
    $       net_commission(offer, user)   Partner contract (minus      Up to ~45 days (clawback
                                          early-cancellation clawbacks) window)
    

    Factoring t3 (P(approve | apply)) away from t1 * t2 (P(apply | impression)) is essential: t1 * t2 measures what the user finds appealing, whereas t3 measures whether the bank's underwriting rules will approve them. Keeping them separate lets us penalize likely rejections explicitly.

  2. Back-of-the-envelope numbers and what they imply

    Let us translate the prompt's 100k DAU assumption into concrete traffic, data sparsity, and compute numbers:

    Traffic
      Daily active users (DAU)       100,000
      Ranked requests per user/day   ~3          -> 300,000 requests/day
      Average / peak QPS             300k / 86,400 ≈ 3.5 QPS avg; ~20 QPS at 6x peak
      Slots shown per request        10          -> 3,000,000 impressions/day
    
    Funnel volume (illustrative baseline rates)
      Impressions                    3,000,000 / day   (100%)
      Clicks (2% of impressions)        60,000 / day   (2.0%)
      Applications (25% of clicks)      15,000 / day   (0.5%)
      Approvals (40% of apps)            6,000 / day   (0.2%)
      Funded / activated (75%)           4,500 / day   (0.15%  = 15 in 10,000 impressions)
    
    Catalog & label sparsity
      Active catalog offers          ~1,000 total; ~150-300 eligible per user after hard rules
      Funded events per offer        4,500 / 1,000 = 4.5/day average
                                     If the top 100 offers capture 70% (3,150/day), the other
                                     900 offers average 1.5 fundings/day—only ~9 per month
                                     inside each of 5 credit-score bands!
    
    Training dataset (90-day rolling window)
      Total impressions              270M rows
      Downsampled table              keep 100% of clicks (5.4M) + 10% of non-clicks (26.5M) ≈ 31.9M rows
      Memory footprint               31.9M rows * 200 float32 features * 4 bytes ≈ 25.5 GB
    

    Three crucial engineering decisions follow directly from this math:

    1. Serving QPS is small (~20 peak QPS), and the catalog is small (~1,000 offers). Unlike a 50M-DAU consumer feed, we do not need an approximate nearest-neighbor retrieval index or GPU cluster. In-memory eligibility rules filter ~1,000 offers down to ~250 eligible candidates in 3 ms, and CPU servers easily score all ~250 candidates inside 20 ms.
    2. Data sparsity is the real enemy. Nine funded events per (offer, credit_band) per month means any standalone funded-conversion model per product will memorize noise. We must share statistical strength across funnel stages and across similar offers via content features.
    3. Downsampled non-clicks require importance weights. When keeping 100% of clicks and 10% of non-clicked impressions, we assign every sampled non-clicked row an importance weight of 1 / 0.1 = 10 in the training loss. That single weight keeps all cumulative funnel probabilities unbiased on the true 0–1 probability scale before we multiply them by dollar commissions.
  3. API contracts and data model

    Partner banks report application, approval, and funding outcomes asynchronously per outbound click. Therefore, clicking an offer generates a unique click_id embedded in the redirect URL, which becomes our join key (attribution key) when signed partner postbacks (server-to-server webhooks) arrive weeks later:

    POST /v1/rank
      {"user_id": "u_123", "surface": "home_cards", "num_slots": 10,
       "context": {"device": "ios", "session_id": "sess_9"}}
    
      200 OK:
      {"request_id": "req_77", "model_version": "mtl_2026_11_20", "policy_version": "obj_v14",
       "items": [{"product_id": "card_481", "position": 1,
                  "impression_id": "imp_8f2", "explore": false}]}
    
    POST /v1/events
      {"impression_id": "imp_8f2", "type": "view | click", "ts": 1764234843}
      -> On "click", server mints click_id = "clk_51a" and redirects user to partner with ?cid=clk_51a
    
    POST /v1/partner/postback          (HMAC-signed webhook or daily SFTP file from partner)
      {"click_id": "clk_51a", "status": "applied | approved | declined | funded | reversed",
       "commission_cents": 15000, "event_ts": 1765444400}
    

    Core tables:

    impressions       impression_id PK, request_id, user_id, product_id, surface, position, ts,
                      model_version, policy_version, t1, t2, t3, t4, e_rev, final_score,
                      explore (bool), propensity, logged_features_ref
    clicks            click_id PK, impression_id, ts
    partner_events    (click_id, status) PK, partner_id, commission_cents, event_ts, received_ts
                      -- composite PK makes duplicate or out-of-order partner retries idempotent
    products          product_id PK, partner_id, category, apr_min, apr_max, annual_fee,
                      rewards_type, target_credit_bands[], eligibility_rules, launched_at, status
    commission_terms  (product_id, valid_from) PK, payout_formula, expected_reversal_rate
                      -- versioned separately; read ONLY by the ranking objective, never by the ML model
    labels            impression_id PK, clicked, applied, approved, funded, net_revenue_cents,
                      elapsed_since_imp, elapsed_since_prev_stage, is_mature_by_stage
    
  4. End-to-end ML architecture and 100 ms latency budget

    We split responsibilities strictly into three online layers—Hard Rules (what may be shown), MTL Probability Scorer (what is likely to happen), and Revenue-Trust Objective (how we value those probabilities)—backed by streaming and daily batch pipelines:

                           ONLINE SERVING PATH (p99 < 100 ms)
     Client --> Ranking API --> Eligibility Rules --> Online Feature --> CPU MTL  --> Objective + Rules +
                                (in-RAM catalog)      Store (Redis)      Scorer       Bandit Slot 5
                     |                                                                      |
                     +<---------------- Ranked Offers + Async Impression Log <--------------+
                                                         |
     App events (views, clicks) -----+                   |
     Partner postbacks (signed) -----+--> Event Bus (Kafka) --> Stream Processor --> Online Store
                                             |                  (1h/24h session &    & Bandit Counts
                                             v                   click counters)
                                     Immutable Data Lake
                                             | (daily Spark job)
                                             v
                        Label Builder: click_id join, dedup, elapsed times & maturity flags
                                             |
                                             v
                 Trainer: MMoE Funnel Model + Censored Delay Loss --> Isotonic Calibration
                                             |
                                             v
                 Offline Gates --> Model Registry --> Shadow --> 5% Canary --> Production
    

    p99 latency breakdown (53 ms budgeted, leaving 47 ms headroom under the 100 ms SLA):

    API gateway + TLS / auth                                 10 ms
    In-memory eligibility & frequency rules (1,000 offers)    3 ms
    Single batched user feature read (online key-value store) 15 ms
    CPU multi-task forward pass (~250-300 candidates)        20 ms
    Objective formula, top-slot approval floor & exploration  3 ms
    JSON serialization (impression log written async)         2 ms
    --------------------------------------------------------------
    Expected p99 server latency                              53 ms  (47 ms safety buffer)
    
  5. Feature engineering and bias prevention

    To avoid training-serving skew (differences between how features are computed live vs. offline), we log the exact feature vector served with each impression and define shared feature transformations across batch and stream:

    • User credit & financial profile: Credit score band, utilization ratio, open trade lines, hard inquiries in last 6 months, self-reported income bracket, existing products held.
    • User activity & session signals: Category pages viewed in current session, clicks and applications over 1h / 24h / 30d, partner declines in the past 90 days.
    • Product content features: Category (card, personal loan, auto refi), partner ID, APR min/max, annual fee, sign-up bonus value, target credit bands, days since launch, smoothed 30-day historical approval rate by credit band.
    • User × product cross features: Margin between the user's credit band and the product's target band (user_band - target_min_band), whether the user already banks with this partner, prior declines by this partner.

    Three deliberate exclusions keep our probabilities clean and compliant:

    1. Never pass commission as an ML input feature. If commission is an input feature, changing a partner's payout tomorrow shifts predicted click and approval probabilities and requires retraining. Keeping commission strictly in the post-model objective formula lets business changes take effect instantaneously while keeping t1..t4 pure behavioral/underwriting probabilities.
    2. Exclude protected demographic attributes and close proxies (such as race, sex, age, marital status, or 9-digit ZIP codes) to uphold fair-lending laws.
    3. Isolate display position to eliminate position bias. Slot 1 gets clicked far more than slot 8 regardless of offer quality. We feed position only into a shallow side bias term added to the t1 (click) logit during training, and fix position = 1 for all candidates at serving time so offers are ranked by intrinsic appeal.
  6. Deep dive 1: multi-task funnel learning for sparse labels

    Why not train four separate gradient-boosted tree models—one for click, one for apply | click, one for approve | apply, and one for fund | approve? We do build that four-model tree pipeline as our Week-1 baseline, because trees train fast on tabular credit data. However, separate per-stage models hit two walls:

    • Sample selection bias: An apply | click model trained only on the 2% of impressions that received clicks learns exclusively from self-selected clickers, then extrapolates poorly when scoring unclicked candidates.
    • Severe late-stage sparsity: The fund | approve model sees only 4,500 positives/day across 1,000 offers, starving new and niche offers of signal.

    We overcome both walls using an Entire-Space Multi-Task Learning (MTL) neural network. Shared lower layers feed four stage towers outputting conditional probabilities t1, t2, t3, t4, while binary cross-entropy (BCE) losses supervise their cumulative products across all impressions (with sampled non-clicks weighted ×10):

    t1 = P(click | imp)     t2 = P(apply | click)     t3 = P(approve | apply)     t4 = P(fund | approve)
    
    Cumulative entire-space loss:
      L = w1 * BCE(clicked,  t1)
        + w2 * BCE(applied,  t1 * t2)
        + w3 * BCE(approved, t1 * t2 * t3)
        + w4 * BCE(funded,   t1 * t2 * t3 * t4)     <-- replaced by censored loss on immature rows
    

    Why this architecture works so well here:

    • Shared representations cure sparsity: 60,000 daily clicks and 15,000 daily applications train rich user and product embeddings that the 4,500-event funding head shares, while product content features let long-tail offers borrow statistical strength from similar cards and loans.
    • Preventing negative transfer with MMoE: Users frequently click high-reward luxury cards (t1 high) that partner banks reject (t3 low). A single shared trunk can suffer negative transfer (helping click accuracy at the expense of approval accuracy). Using a Multi-gate Mixture of Experts (MMoE)—say 5 small shared expert sub-networks (200 -> 256 -> 128) where each of the 4 stage towers learns its own soft gating weights over the 5 experts—lets t1 lean on engagement experts while t3 leans on underwriting experts.
    • Tiny CPU footprint: Five experts of 200 -> 256 -> 128 plus four 128 -> 64 -> 1 towers require only ~457k multiply-adds per candidate. Scoring 300 candidates is 300 * 457k ≈ 137M multiply-adds—just a few milliseconds on modern CPU vector instructions!
    • Post-hoc calibration is mandatory: Because we multiply t1 * t2 * t3 * t4 * dollars, ranking order (AUC) is not enough: a 2x overestimate in t3 doubles illusory expected revenue. After training, we fit isotonic regression (a monotonic probability-calibration curve) on each stage using a mature validation window.
  7. Deep dive 2: delayed feedback with proxy labels and censored regression

    If we train today on last week's impressions and label every loan without a funding postback yet as funded = 0, our model learns a false lesson: that 3-week personal loans convert far worse than instant credit cards, and that brand-new offers barely convert at all!

    We handle delayed outcomes by pairing fast early-funnel targets with censored survival modeling (censored regression):

    1. Empirical maturity windows: From historical delay logs per product category, we define the elapsed window by which 95% of conversions arrive—for example: click = 1 hour, apply = 2 days, approve = 10 days, and fund = 40 days. Rows older than a stage's maturity window carry final ground-truth labels.
    2. Application submission as a fast proxy label: Because t1 (click) and t2 (application submission) mature within 48 hours, our model learns fresh user preferences and offer appeal from data right up to yesterday, without waiting 40 days for loan disbursement.
    3. Censored likelihood for immature late-stage rows: In survival analysis, an application submitted 3 days ago with no funding postback yet is right-censored—meaning we know conversion has not happened by day 3, not that it will never happen. Model the stage's eventual conversion probability as p and its conditional delay D (given eventual conversion) as an exponential distribution with rate lam (1 / lam = mean delay for that product type, so P(D > e | converts) = exp(-lam * e)):
    Case 1 — Converted after observed delay d:
      log_likelihood = log(p) + log(lam) - lam * d
    
    Case 2 — Not converted YET after elapsed time e (right-censored):
      Probability of seeing nothing by time e
        = P(never converts) + P(converts eventually AND delay > e)
        = (1 - p) + p * exp(-lam * e)
    
      log_likelihood = log(1 - p + p * exp(-lam * e))
    

    Check the intuition with concrete numbers: suppose personal loans take 1 / lam = 10 days on average to fund after approval.

    • If only e = 1 day has passed (exp(-0.1) ≈ 0.905), 1 - p + 0.905 * p = 1 - 0.095 * p, so the example exerts almost zero downward push on p.
    • Once e = 40 days have passed (exp(-4.0) ≈ 0.018), log(1 - 0.982 * p) ≈ log(1 - p), behaving like a full negative!

    Finally, some partners claw back commissions if a user cancels within 30–60 days (reversals). Before the clawback window closes, we multiply gross commission by (1 - expected_reversal_rate[partner]), switching to realized net revenue once mature.

  8. Deep dive 3: the revenue-vs-relevance ranking objective

    How should we combine conversion probabilities t1..t4 and partner payouts into one ranking score? Look at why both naive extremes fail:

    • Rank purely by conversion probability (P_fund = t1 * t2 * t3 * t4): Users see easy-to-approve, zero-fee cards that pay $20 commissions, leaving huge platform revenue on the table.
    • Rank purely by greedy expected revenue (P_fund * net_commission): Suppose Card X pays a massive $350 commission with only 10% approval odds (t3 = 0.10), while Loan Y pays $120 with 70% approval odds (t3 = 0.70). Greedy expected revenue can easily rank Card X #1—causing 9 out of 10 applicants to take a hard credit pull and get rejected! Those rejected users lose trust and stop coming back, destroying next quarter's revenue.

    Solution: put user relevance and trust into the same unit (dollars) via net customer lifetime impact:

    P_apply     = t1 * t2
    P_approve   = t1 * t2 * t3
    P_decline   = t1 * t2 * (1 - t3)
    P_fund      = t1 * t2 * t3 * t4
    
    e_rev       = P_fund * commission(offer, user) * (1 - reversal_rate(offer))
    final_score = e_rev  +  A * P_approve  -  D * P_decline
    
    • D (decline penalty in dollars) is the expected 90-day future platform revenue lost when a user applies and gets rejected, compared against matched users (same credit profile and prior activity) who did not apply.
    • A (approval bonus in dollars) is the expected 90-day future repeat revenue gained when a user applies and gets approved, compared against the same matched non-applicant baseline. (Teams that want an even simpler single-knob alternative sometimes use a risk-averse power formula P_fund^alpha * net_commission with alpha > 1, though the explicit - D * P_decline term is sharper because an unclicked offer causes zero rejections whereas a high-click, low-approval offer actively harms users.)

    Post-scoring business guardrails enforce hard safety boundaries on top of final_score:

    • Top-3 approval floor: Slots 1–3 require t3 >= tau (e.g., tau = 0.30), because top slots carry implicit platform endorsement.
    • Partner diversity: At most 2 products from the same partner bank in the top 5.
    • Smooth cap pacing: If a partner caps applications at 500/day, throttle exposure smoothly across hours rather than running out at 11:00 AM.

    By replaying historical requests offline across candidate (A, D, tau) values using our calibrated probabilities, we plot an explicit Expected Revenue vs. Approval Rate Pareto frontier, let leadership choose 2–3 operating points, and validate them in a user-level A/B test.

  9. Cold start for new products and new users

    Cold-starting a newly launched financial product

    1. Day-0 warm start from content & partner features: Even with zero impressions, a new card has structured attributes (APR, annual fee, rewards rate, target credit band, partner ID). The MMoE network predicts a sensible initial rate p_hat from similar existing cards, and the partner's historical underwriting informs t3.
    2. Safe Thompson-sampling bandit in Slot 5: Without exploration, slight underestimation could bury a great new offer forever. On 10% of requests (~30,000 impressions/day), we reserve Slot 5 as a dedicated exploration slot—restricted strictly to new offers (< 14 days old) that pass hard eligibility rules and t3 >= 0.30 (never explore at the expense of a user's credit score!).
    3. Fast proxy reward + informative Beta prior: Funding takes 40 days—far too slow for a bandit loop. Instead, the bandit optimizes application rate per impression (t1 * t2, ~0.5% average), which matures within 48 hours. Each new offer maintains a Beta distribution (a probability distribution over conversion rates between 0 and 1) initialized to Beta(alpha_0, beta_0) = Beta(200 * p_hat, 200 * (1 - p_hat))—equivalent to 200 pseudo-impressions centered at the model's initial prediction—and updated hourly as Beta(alpha_0 + apps, beta_0 + imps - apps). On each exploration request, Thompson sampling draws one random sample per candidate offer from its Beta curve and shows the highest draw, logging its selection probability (propensity).
    4. Graduation math: At a p = 0.5% (0.005) apply rate, the relative standard error of the observed rate after n impressions is sqrt((1 - p) / (n * p)). Reaching ~30% relative precision takes n ≈ 0.995 / (0.005 * 0.09) ≈ 2,200 impressions (~11 applications). With 30,000 exploration impressions/day, 10–15 new offers graduate into standard exploitation slots within 1–2 days!

    Cold-starting a new user

    • Onboarding usually captures stated financial goal ("build credit", "pay off debt"), state, and—once consented—a soft credit-bureau snapshot. Missing behavioral counts default to 0 alongside an explicit has_no_history = 1 indicator feature.
    • Before any credit pull, request #1 ranks safe, popular offers for the user's state and stated goal; as soon as the user clicks or filters 2–3 offers, streaming session features personalize the very next page load within seconds.
  10. Evaluation, drift monitoring, and failure handling

    Offline evaluation & online A/B testing. Offline validation uses a strict chronological split evaluated only on mature labels, gating releases on per-stage log loss, AUC, decile calibration (predicted / observed within 0.90–1.10 per product category and credit band), and revenue-weighted NDCG@5 (Normalized Discounted Cumulative Gain, rewarding high-net-value conversions near slot 1). Online A/B tests randomize at the user level over a 28-day exposure window:

    • Because net funded revenue per user is zero-inflated and heavy-tailed, we apply CUPED (Controlled-experiment Using Pre-Experiment Data—a statistical adjustment that subtracts pre-experiment user activity variance so we can detect smaller revenue lifts with 100k DAU).
    • Early guardrail reads use expected net revenue from submitted applications (apps * calibrated t3 * t4 * net_commission), while final launch confirmation tracks realized funded revenue and 30-day user retention once maturity windows close.

    Detecting conversion and revenue drift without waiting 40 days. If a partner quietly tightens underwriting or raises APRs on Monday, waiting 40 days for funded labels to mature would bleed revenue for six weeks. Instead, we compare conversions observed so far against delay-adjusted expected conversions so far:

    For all impressions i from the past 14 days (with elapsed age e_i):
      expected_conversions_so_far = sum_i [ predicted_p_i * F_delay(e_i) ]
      calibration_ratio_so_far    = observed_conversions_so_far / expected_conversions_so_far
    

    Here F_delay(e_i) = 1 - exp(-lam * e_i) is the historical fraction of conversions that normally arrive within e_i days. If calibration_ratio_so_far drops outside 0.85–1.15 for 48 hours—overall or for one partner—we alert immediately! Alongside this, we track:

    • Feature drift: Daily Population Stability Index (PSI) on credit scores, utilization, and inquiries (PSI > 0.2 flags macroeconomic or user-mix shifts).
    • Partner postback health vs. real conversion drift: Track hourly postback webhook counts per partner separately from conversion rate. If a partner's postback count drops to zero abruptly, our label builder pauses training on that partner's recent clicks instead of learning fake 0% conversion!
    • Realized vs. predicted revenue per 1,000 impressions (RPM): Catches silent commission-table mistakes or rising partner clawback rates, reconciled monthly with finance ledgers.

    Graceful failure handling. If the online feature store exceeds its 15 ms timeout, fall back to cached credit-band features; if the CPU model server fails, serve an hourly precomputed safe ranking per (credit_band, surface) with hard eligibility rules still enforced in process.

Intuition & how it works

Imagine running a commission-based apartment-finder service where landlords pay you different referral fees—some $60, some $350—only after a renter tours, applies, passes a strict background check, and signs a lease weeks later. If you greedily push every renter toward the $350 luxury penthouse, landlords reject 90% of them, renters waste application fees and stop trusting your recommendations, and you earn less money over the year than if you matched each renter with apartments that pay well and will actually approve them.

Why do naive ML designs fall short here? Training a single classifier directly on "did this impression lead to a funded loan?" fails because at 100k daily active users only ~4,500 loans fund per day (~0.15% of impressions) across 1,000 products, and funding takes up to six weeks—so rare products starve for data and recent impressions look like failures simply because banks have not finished processing them. Meanwhile, ranking offers purely by P(funded) * commission systematically promotes high-payout, low-approval products that trigger hard credit inquiries (official lender checks that temporarily lower a user's credit score) and drive rejected users away.

Walk through a concrete example for one user (credit_score = 680) and three eligible offers:

  • Card X: $300 net commission, luxury card with low 10% approval odds for a 680 score.
  • Loan Y: $200 net commission, personal loan with 65% approval odds.
  • Card Z: $60 net commission, starter card with 85% approval odds.
  1. Multi-task probability estimation: Rather than one sparse classifier, a Multi-Task Learning (MTL) network (a neural network with shared lower layers and separate output heads per funnel stage) predicts t1 = P(click), t2 = P(apply | click), t3 = P(approve | apply), and t4 = P(fund | approve) in ~15 ms on CPU:
    • Card X: P_apply = 0.02, t3 = 0.10 (P_approve = 0.0020, P_decline = 0.0180), t4 = 0.80 -> P_fund = 0.0016, e_rev = 0.0016 * $300 = $0.48.
    • Loan Y: P_apply = 0.015, t3 = 0.65 (P_approve = 0.00975, P_decline = 0.00525), t4 = 0.75 -> P_fund = 0.00731, e_rev = 0.00731 * $200 = $1.46.
    • Card Z: P_apply = 0.018, t3 = 0.85 (P_approve = 0.0153, P_decline = 0.0027), t4 = 0.80 -> P_fund = 0.01224, e_rev = 0.01224 * $60 = $0.73.
  2. Trust-adjusted revenue ranking: Using estimated long-term retention bonus A = $10 per approval and churn cost D = $30 per rejection (score = e_rev + A * P_approve - D * P_decline), Loan Y scores $1.46 + $0.10 - $0.16 = $1.40 (#1), Card Z scores $0.73 + $0.15 - $0.08 = $0.80 (#2), and Card X drops to $0.48 + $0.02 - $0.54 = -$0.04 (and is also blocked from the top 3 slots by our t3 >= 0.30 safety floor).
  3. Cold-start exploration: If a brand-new Card W launches today with t3 >= 0.30, Slot 5 reserves 10% of traffic for Thompson sampling (a bandit algorithm that samples from each new offer's conversion uncertainty curve) using fast 48-hour application signals until Card W gathers ~2,200 impressions (~11 applications) and graduates into normal ranking.

Key trade-offs

  • Multi-task funnel network vs. separate per-stage models: Four standalone gradient-boosted tree models are fast to build as a baseline, but late-stage models suffer from sample selection bias (training only on self-selected clickers/applicants while scoring all candidates) and extreme sparsity (~9 fundings/month per long-tail offer and credit band). An entire-space Multi-gate Mixture of Experts (MMoE) network (where multiple shared sub-networks feed task-specific gates) shares dense click/apply signal without negative transfer (tasks hurting one another when click appeal and underwriting conflict), at the cost of tuning multi-task loss weights.
  • Censored survival loss + proxy labels vs. waiting for mature labels: Waiting 40 days for loan funding labels gives zero delay bias, but leaves the model six weeks stale and blind to new offers. Combining fast 48-hour application proxy labels with a right-censored survival likelihood (treating recent non-funded rows as "still waiting" according to an exponential delay curve rather than as failures) lets the model train on fresh data, provided we validate calibration on mature holdout cohorts.
  • Trust-penalized net value vs. greedy expected revenue: Ranking by e_rev alone maximizes this week's commissions while eroding user retention via declined applications. Subtracting D * P_decline (and enforcing t3 >= tau on top slots) sacrifices a small slice of immediate high-risk commission in exchange for sustained 90-day user retention and trust.
  • Keeping commission outside the ML model vs. feeding it as a feature: Excluding commission from the neural network means t1..t4 stay pure behavioral and underwriting probabilities, so business teams can update payouts or trust weights (A, D) in milliseconds without retraining. The minor trade-off is that any visible promotional badge must be passed as its own explicit UI feature.
  • Calibrated probabilities vs. pure ranking order (AUC): A model can improve AUC (how often positives rank above negatives) while drifting in probability scale. Because we multiply four probabilities by dollar payouts, isotonic calibration (fitting a monotonic curve so predicted probabilities match observed rates) is a mandatory release gate.
  • Dedicated Slot-5 bandit exploration vs. pure exploitation: Spending Slot 5 on 10% of requests (1% of total impressions) carries a small, bounded opportunity cost today so newly launched products rapidly collect unbiased conversion data instead of starving at the bottom of the catalog.

Common mistakes

  • Training a single binary model on funded events only (ignoring 99.85% of funnel signal) or training conditional stages only on clicked rows without entire-space supervision.
  • Labeling recent uncompleted or unfunded clicks as 0, which severely penalizes slower loan products and newly launched offers.
  • Ranking by P(fund) * commission with no rejection penalty or approval-odds floor, driving users into painful hard-inquiry credit declines.
  • Passing commission amounts as input features into the probability model, tangling business contract changes with user propensity estimates.
  • Downsampling non-clicked impressions without importance weights, inflating predicted probabilities and corrupting every dollar expectation downstream.
  • Ignoring display position bias, causing the model to confuse "shown in slot 1" with "users love this product."
  • Waiting 40–50 days to monitor conversion drift, or mistaking a broken partner postback webhook for a real collapse in product conversion.
  • Running request-level A/B tests instead of user-level A/B tests, making it impossible to measure multi-week funding outcomes or user churn after rejections.

Follow-up questions

  • What changes would you make if live traffic showed the ranker heavily favoring high-commission offers that lenders frequently decline? First diagnose whether the root cause is miscalibrated probabilities or an overly greedy objective. Check the predicted-to-observed ratio of t3 (P(approve | apply)) sliced by partner and credit band: if t3 is overestimated on high-payout offers (often due to early self-selection bias), recalibrate t3 per partner/category using isotonic regression on mature decisions and incorporate soft-pull pre-qualification outcomes where available. If t3 is well calibrated, the objective weights are too greedy: increase the rejection penalty D in score = e_rev + A * P_approve - D * P_decline, raise the top-slot approval floor tau (for example from 0.25 to 0.35), or apply a concave transform to payouts (commission^beta with beta < 1) so an extreme commission cannot overwhelm weak approval odds, then verify on an A/B test with decline rate and 30-day retention as strict guardrails.
  • How do you guarantee that credit product rankings comply with fair-lending laws and regulatory audits? Under US fair-lending frameworks such as the Equal Credit Opportunity Act (ECOA) and Regulation B (which prohibit credit discrimination and improper discouragement across protected classes including race, color, religion, national origin, sex, marital status, and age, and extend to platforms that regularly refer applicants to lenders), start by excluding all protected attributes and high-correlation proxies (such as fine-grained geocodes) from model features. Next, run disparate-impact audits before every model or objective release—comparing approval odds, APR tiers, and expected value shown across demographic groups both overall and conditioned on identical credit bands; when demographic labels are not collected directly, compliance teams evaluate disparity inside a restricted clean room using BISG (Bayesian Improved Surname Geocoding), a standard statistical proxy method documented by the CFPB. Finally, log every ranking's exact feature vector, model version, and policy version immutably so any individual recommendation can be reconstructed and explained during regulatory review.
  • Which streaming and serving components would you add so rankings adapt to a user's latest in-app actions within seconds? Add a low-latency streaming loop alongside the daily batch pipeline: stream user events (view, click, filter, apply) into Apache Kafka (a distributed event log), use Apache Flink (a stateful stream processor) to update rolling window features (clicks_1h, category_affinity_session, recent_dismissals) inside an in-memory online feature store (such as Redis) within 1–2 seconds, and update the Slot-5 bandit's Beta(alpha, beta) counts every few minutes. If model weights themselves must adapt intra-day, perform hourly incremental fine-tuning only on the fast early heads (t1 click and t2 apply, whose labels arrive quickly, using importance-weighted delay correction) while keeping the slow underwriting heads (t3, t4) on stable daily batch retrains. Gate every streaming model push behind automated shadow checks on calibration and latency with instant registry rollback so a burst of noisy traffic or bot clicks cannot corrupt live rankings.

Follow-up questions

Similar questions

More Creditkarma interview questions

All 2 Creditkarma questions →