Katkat

Design a Homepage Store Recommender

DoorDashData Scientist · Onsite

Last updated

This question assesses the ability to design an end-to-end, low-latency recommendation system for a food delivery marketplace, focusing on candidate retrieval strategies, real-time personalization, and system architecture.

Problem Statement

Design a machine learning system for a 'Recommended for You' section on the homepage of a food delivery app. The primary goal is to surface restaurants that a user is most likely to order from, balancing relevance, geographic proximity, and business objectives like delivery fee efficiency and fleet capacity.

Requirements

  • Latency: The module must return results in under 100ms.
  • Constraints: Recommendations must be physically reachable by a courier (e.g., within a specific delivery radius) and currently open for orders.
  • Scale: Handle millions of active users and tens of thousands of restaurants with high request throughput.

Scope

Your design should address:

  1. High-level Architecture: How do you structure the flow from request to final ranked results?
  2. Candidate Generation: How do you narrow down the pool of restaurants effectively given spatial constraints?
  3. Ranking Strategy: Describe the model architecture, feature engineering (e.g., user history, restaurant popularity, time-of-day), and how you handle the cold-start problem.
  4. Evaluation: How do you measure the quality of recommendations offline and online?

Hints

Hint 1

Consider a multi-stage funnel approach: start with a broad pool and narrow it down using lightweight retrievers before applying a more complex ranking model.

Hint 2

Utilize geohashing or H3 indexing to efficiently filter restaurants based on the user's current coordinates.

Hint 3

Think about how to integrate real-time signals (e.g., current app state) versus long-term features (e.g., user preference embeddings) without violating latency constraints.

Follow-up questions

  • How would you optimize the ranking model to prioritize 'new' restaurants to mitigate echo-chamber effects and satisfy exploration/exploitation requirements?
  • If delivery fleet capacity is low in a specific neighborhood, how would you modify the model's output to ensure operational stability?
  • How would you design an A/B testing framework to measure the impact of a new recommendation algorithm on both user conversion and courier utilization?