Day 109 of 133

Design ads CTR prediction at scale + DSA review

Billion-cardinality features; cross features; calibration.

DSA · NeetCode Heap / Priority Queue

  • Kth Largest Element IN A StreamDSA · Heap / Priority Queue

    Interview questions to prep

    1. Why is a heap the right structure? Could a balanced BST or sorted list work — why is heap better?
    2. Explain the heap-of-k pattern: keep size k, push new, pop if over k. What's the resulting complexity?
    3. What does the comparator look like, and how would you tweak it to flip min/max behaviour?

ML System Design · Ads CTR

  • Interview questions to prep

    1. Walk me through designing Meta's ad CTR prediction system.
    2. How do you handle billion-cardinality features (user_id, ad_id) at scale?
  • Interview questions to prep

    1. How do cross features (e.g., user × ad) work, and how do you scale them?
    2. When does DCN / DeepFM beat hand-crafted cross features in production?
  • Calibration & bid optimizationML System DesignEugene Yan

    Interview questions to prep

    1. Why is calibration critical for ad ranking, and how do you evaluate it?
    2. How would you recalibrate after a model retrain without disturbing existing bid logic?

References & further reading