Design a Conversion-Optimized Product Ranking Engine
Machine LearningModel answerLast updated
Design an end-to-end ML ranking system for a financial product marketplace that maximizes revenue while managing delayed labels, sparse conversions, and cold-start challenges.
Context
You're building the ranking layer for a marketplace that surfaces financial products — think loans, credit cards, deposit accounts — to users who visit the platform. The platform earns a commission when users complete certain actions: sometimes it's an approved application, sometimes a funded account, sometimes just a qualified click. These payouts vary by product and by funnel stage.
Your job is to design the full ML system that decides which products to show each user and in what order.
What to cover
Architecture. Walk through the end-to-end pipeline: how you collect and serve features, how you train and deploy models, and how a ranking request flows through the system at inference time. Include rough latency targets for each stage and explain how you stay within a 100ms p99 budget.
Funnel modeling. A user journey from seeing a product to completing a funded account passes through several intermediate steps. Explain how you model this chain of events, why naively training a single "conversion" model causes problems, and what architectural choices address those problems.
Delayed and sparse labels. Most impressions never convert. Among those that do, the final outcome may arrive weeks later. Describe at least two concrete techniques for training with incomplete labels and explain the trade-offs of each.
Ranking objective. Define the score you actually rank by. How do you combine predicted conversion probability with revenue? What terms would you add to protect user trust or account for the cost of a declined application? How do you set and tune the relative weights?
Cold start. A new product launches with zero historical data. A new user arrives with no on-platform history. Describe a different strategy for each case.
Monitoring. Once the system is live, what signals tell you something has drifted — either in model quality or in business outcomes? What would trigger a rollback versus a retrain?
Constraints and assumptions
- 100k daily active users, each generating roughly 3 sessions.
- Millions of rows of historical impression and event logs are available.
- End-to-end ranking latency must be under 100ms at p99.
- The final conversion event (e.g., funded account) arrives on average 7–30 days after the impression.
- Expect an impression-to-funded rate around 0.3%.
What a strong answer looks like
A strong answer reasons from first principles, gives concrete numbers where useful (QPS, label volume, window lengths), names specific modeling approaches with their trade-offs, and anticipates failure modes. It does not just list buzzwords.
Hints
Hint 1
Start by estimating label volumes at each funnel stage from the given numbers. The gap between impression volume and funding volume drives almost every architectural decision downstream.
Hint 2
Think about why training a single model on funded-account labels introduces two distinct problems: one is about bias in which examples you see, the other is about freshness. Treat them separately.
Hint 3
The ranking score is a business policy, not just a model output. Sketch it as a formula and reason about what happens at the extremes — what does a product with high payout but low approval odds look like under different formulations?
Model answer
Hard Try it yourself first — then compare your approach, complexity and edge cases.
1. Size the problem first
Before designing anything, work out what the data actually looks like.
With 100k DAU at 3 sessions each and 10 slots per ranking request, you get roughly 3M impressions per day. Applying representative funnel rates:
| Stage | Daily volume |
|---|---|
| Impressions | ~3,000,000 |
| Clicks (CTR ~5%) | ~150,000 |
| Applications (20% of clicks) | ~30,000 |
| Approvals (40% of applications) | ~12,000 |
| Funded (70% of approvals) | ~8,400 |
The impression-to-funded rate is about 0.28%. At 300k ranking requests per day, average QPS is ~3.5 and peak is ~35–40. That's a low-throughput system, so the 100ms budget is about model and feature latency, not raw throughput.
Two things follow immediately: label sparsity is the central problem, and shallow funnel stages (clicks, applications) are abundant enough to be useful training signal even when funding labels are scarce.
2. System architecture
A ranking request flows through five stages:
Candidate generation (<10ms). Apply hard eligibility rules — regulatory, credit-band, existing-account filters — to reduce the full catalog (potentially hundreds of products) to 50–300 candidates. This is rule-based, not ML.
Feature fetch (<15ms). Pull user features (credit attributes, platform engagement, recency signals) from an online feature store such as Redis or DynamoDB. Product features are small enough to cache in memory.
Scoring model (<30ms). Run all candidates through the ranking model in one batched forward pass.
Re-ranking and policy layer (<10ms). Apply the business objective formula, add exploration noise for new products, enforce diversity constraints.
Response and logging (<5ms). Return ranked slots. Log the request, scores, and the serving policy's propensity for each item — this is essential for unbiased offline evaluation later.
Total: ~70ms, leaving headroom under 100ms. Async logging via Kafka keeps the critical path clean.
3. Funnel modeling with multi-task learning
The naive approach — train one model to predict P(funded | impression) — fails in two ways. First, you only observe ~8k positive labels per day, so the model is starved. Second, if you train each stage's model only on users who reached the previous stage, you introduce sample selection bias: the approval model sees only applicants, but at serving time it scores everyone.
The better approach models the full funnel as a chain of conditional probabilities, all anchored to the impression:
P(funded | imp) = P(click | imp)
× P(apply | click)
× P(approve | apply)
× P(funded | approve)
In practice this follows the ESMM pattern: shared bottom embeddings for user, product, and context, with a separate tower per stage. Each tower's loss is computed against impression-level labels (not stage-level), which eliminates selection bias. The abundant click and apply signals train the shared representation; the sparse approval and funding towers learn small residuals on top.
If the tasks show conflicting gradients, MMoE or PLE gating helps route different information to different towers.
4. Handling delayed and sparse labels
An impression that hasn't funded yet is not a confirmed negative — it may just be waiting. Three techniques address this:
Maturity windows. Define a minimum age before an impression enters training for each head: ~1 hour for clicks, ~1 day for applications, ~7 days for approvals, ~30 days for funding. The shallow heads retrain daily on fresh data; the deep heads train on older, mature data. Each head stays unbiased for its own stage.
Delayed-feedback modeling. To incorporate recent impressions into deep heads without waiting 30 days, model P(convert) and P(delay ≤ t | convert) jointly, treating unconverted recent rows as right-censored observations. Chapelle's delayed-feedback model with an exponential or Weibull delay distribution is the standard approach. An alternative is fake-negative correction: immediately label a recent impression as negative, then apply importance-weight correction when the positive arrives later.
Proxy labels. Application submission and approval are fast, strong proxies for funding. Learn calibrated mappings like P(funded | approved, product) and use them to accelerate experiments. Results on proxies can be confirmed on matured revenue after a few weeks.
Common mistake: training the deep funnel heads on only-converted impressions. This makes the model implicitly estimate P(approve | applicant) rather than P(approve | impression), and it will overestimate approval odds for everyone at serving time.
5. The ranking objective
Rank each candidate by a score that combines expected revenue with a user-value term:
score(u, i) = Σ_s P(reach stage s | imp) × payout_i(s) # expected revenue
+ λ × V_user(u, i) # relevance / trust
− μ × P(apply) × (1 − P(approve | apply)) # decline penalty
Expected revenue multiplies the estimated probability of reaching each payout-triggering stage by the corresponding commission. Products that pay on approval and products that pay on funding get scored differently.
V_user can be predicted approval odds, estimated savings vs. the user's current product, or a long-term engagement value estimate. It keeps the system from optimizing purely on high-commission products that users rarely qualify for.
The decline penalty is easy to overlook. A declined application costs the user a hard credit inquiry and erodes platform trust. Penalizing it explicitly discourages surfacing aspirational products to users who are unlikely to be approved.
A few important implementation notes. Calibration is not optional — you're multiplying probabilities by dollar amounts, so miscalibrated models directly distort rankings. Use isotonic regression or Platt scaling per head and monitor calibration by product tier. Set a hard floor on estimated approval odds (e.g., don't show any product with P(approve) < 15%) as a hard filter before the score formula runs. Tune λ and μ by sweeping them in online experiments and plotting the Pareto frontier of revenue versus approval rate and long-term retention.
6. Cold start
New products. On launch day, a new product has no impression history. Use content-based priors: pass product attributes (category, APR range, target credit band, issuer) through the shared towers. A new card behaves like similar cards on day one. Run a short Thompson Sampling or UCB exploration phase to accumulate real signal within days. Confidence intervals collapse as impressions accumulate and the model transitions to exploitation naturally.
New users. With no on-platform history, fall back to demographic and credit-bureau signals (credit band, age of oldest account, estimated income) combined with population-level priors for that segment. A two-tower retrieval model trained on user-segment embeddings is useful here. As the user accumulates sessions, their real features replace the prior gradually — no sharp transition needed.
7. Monitoring and rollback triggers
Monitor at two levels: model health and business outcomes.
Model health metrics: calibration error per funnel head, feature distribution shift (PSI on top features), prediction score distribution drift. Sudden shifts here usually indicate upstream data pipeline issues rather than true behavioral change.
Business outcome metrics: approval rate by product, revenue per mille impressions (RPM), funnel drop-off rates at each stage, and long-term cohort retention. Degradation in approval rate with stable predicted approval odds signals that issuer criteria changed without the model knowing. Divergence between predicted and realized funding rates is a sign of model drift.
Rollback triggers: calibration error exceeds a threshold on a deep head, RPM drops >10% relative to the control in an A/B test, or approval rate drops significantly without a corresponding change in user credit profile distribution. A shadow deployment that runs the new model alongside the current one before receiving real traffic is the safest rollout pattern, followed by a canary at 5–10% traffic before full launch.