PracHub
QuestionsLearningGuidesInterview Prep
|Home/ML System Design/Pinterest

Design User and Item Embeddings from Long Histories

Last updated: Jul 14, 2026

Quick Overview

Design user and visual-item embeddings for retrieval or recommendation when histories can contain 160,000 events. Address time-correct training data, multimodal cold start, efficient long-history summaries, incremental freshness, versioned nearest-neighbor serving, privacy, and deletion.

  • medium
  • Pinterest
  • ML System Design
  • Machine Learning Engineer

Design User and Item Embeddings from Long Histories

Company: Pinterest

Role: Machine Learning Engineer

Category: ML System Design

Difficulty: medium

Interview Round: Onsite

# Design User and Item Embeddings from Long Histories Design an embedding system that represents users and visual-content items for retrieval or recommendation. User histories may contain up to 160000 events. ### Constraints & Assumptions - Practice assumption: events include impressions, saves, clicks, hides, and timestamps. - Items have image and metadata features; new items may have little interaction history. - The online retrieval path has a strict latency budget and serves millions of users. - Training examples must respect event time to avoid future leakage. - The long-history limit is a prompt constraint, not a claim about any production implementation. ### Clarifying Questions to Ask - Is the embedding used for candidate retrieval, ranking features, or both? - What action and time horizon define relevance? - How fresh must user and item representations be? - Which privacy, retention, and deletion rules constrain history? ### Part 1: Objective and Training Data Define examples, positives, negatives, loss, leakage controls, and offline evaluation. #### Hints - The way an item was exposed affects what a missing interaction means. #### What This Part Should Cover - Objective aligned with serving use - Defensible negative sampling - Time-correct splits and metrics ### Part 2: Model and Long-History Representation Choose user and item encoders and explain how you preserve useful signals from as many as 160000 events without processing all events naively on every request. #### Hints - Different time scales may deserve different summaries. - A representation can be updated incrementally. #### What This Part Should Cover - Multimodal item representation - Efficient long-sequence strategy - Freshness and cold-start behavior ### Part 3: Serving, Evaluation, and Safety Design embedding generation, storage, nearest-neighbor retrieval, refresh, rollout, monitoring, and deletion. #### Hints - Training-serving skew can occur in both features and index versions. #### What This Part Should Cover - Versioned online architecture - Latency and freshness trade-offs - Online metrics, guardrails, and privacy operations ### What a Strong Answer Covers - A clear target and unbiased evaluation strategy - A scalable approach to very long histories - Cold-start and multimodal item handling - Versioned retrieval serving with monitoring and deletion guarantees ### Follow-up Questions - How would you preserve multiple user interests in one retrieval request? - How would you detect popularity collapse in the embedding space? - What changes if event history must be deleted within minutes? - When would a sequence model outperform engineered summaries enough to justify its cost?

Quick Answer: Design user and visual-item embeddings for retrieval or recommendation when histories can contain 160,000 events. Address time-correct training data, multimodal cold start, efficient long-history summaries, incremental freshness, versioned nearest-neighbor serving, privacy, and deletion.

Related Interview Questions

  • Rank Newly Launched Ads Under Cold Start - Pinterest (medium)
  • Design notification and feed recommenders - Pinterest (medium)
  • Design Detection Systems for Risk and Safety - Pinterest (medium)
  • Design a real-time home feed ranker - Pinterest (hard)
|Home/ML System Design/Pinterest

Design User and Item Embeddings from Long Histories

Pinterest logo
Pinterest
Jul 2, 2026, 12:00 AM
mediumMachine Learning EngineerOnsiteML System Design
4
0

Design User and Item Embeddings from Long Histories

Design an embedding system that represents users and visual-content items for retrieval or recommendation. User histories may contain up to 160000 events.

Constraints & Assumptions

  • Practice assumption: events include impressions, saves, clicks, hides, and timestamps.
  • Items have image and metadata features; new items may have little interaction history.
  • The online retrieval path has a strict latency budget and serves millions of users.
  • Training examples must respect event time to avoid future leakage.
  • The long-history limit is a prompt constraint, not a claim about any production implementation.

Clarifying Questions to Ask Guidance

  • Is the embedding used for candidate retrieval, ranking features, or both?
  • What action and time horizon define relevance?
  • How fresh must user and item representations be?
  • Which privacy, retention, and deletion rules constrain history?

Part 1: Objective and Training Data

Define examples, positives, negatives, loss, leakage controls, and offline evaluation.

Hints

  • The way an item was exposed affects what a missing interaction means.

What This Part Should Cover Guidance

  • Objective aligned with serving use
  • Defensible negative sampling
  • Time-correct splits and metrics

Part 2: Model and Long-History Representation

Choose user and item encoders and explain how you preserve useful signals from as many as 160000 events without processing all events naively on every request.

Hints

  • Different time scales may deserve different summaries.
  • A representation can be updated incrementally.

What This Part Should Cover Guidance

  • Multimodal item representation
  • Efficient long-sequence strategy
  • Freshness and cold-start behavior

Part 3: Serving, Evaluation, and Safety

Design embedding generation, storage, nearest-neighbor retrieval, refresh, rollout, monitoring, and deletion.

Hints

  • Training-serving skew can occur in both features and index versions.

What This Part Should Cover Guidance

  • Versioned online architecture
  • Latency and freshness trade-offs
  • Online metrics, guardrails, and privacy operations

What a Strong Answer Covers Guidance

  • A clear target and unbiased evaluation strategy
  • A scalable approach to very long histories
  • Cold-start and multimodal item handling
  • Versioned retrieval serving with monitoring and deletion guarantees

Follow-up Questions Guidance

  • How would you preserve multiple user interests in one retrieval request?
  • How would you detect popularity collapse in the embedding space?
  • What changes if event history must be deleted within minutes?
  • When would a sequence model outperform engineered summaries enough to justify its cost?

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More ML System Design•More Pinterest•More Machine Learning Engineer•Pinterest Machine Learning Engineer•Pinterest ML System Design•Machine Learning Engineer ML System Design

Your design canvas — auto-saved

PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.