Design a Link Preview Cache for URLs Shared in Messenger
Last updated: November 29, 2026
Quick Overview
Design the service that fetches and caches link previews (title, description, thumbnail) for URLs shared in Messenger and Facebook posts, serving most previews from cache while staying safe from malicious sites.
Meta
November 29, 20260
0
0 solved
Design the service that fetches and caches link previews (title, description, thumbnail) for URLs shared in Messenger and Facebook posts, serving most previews from cache while staying safe from malicious sites.
Link previews appear across Meta's apps, and the same popular URL may be shared millions of times. The interviewer is checking a simple fetch-and-cache design with normalized keys, TTLs, protection against server-side request forgery, and rate limiting outbound fetches to third-party sites.
What the Interviewer Expects
- Normalize URLs into good cache keys
- Choose TTLs and refresh strategy
- Isolate the fetcher to prevent server-side request forgery
- Rate limit fetches per destination domain
- Integrate with malicious link checks
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How would you handle sites that return different content to bots?
- What if a publisher updates the article's image and wants the preview refreshed?
- How does this differ for end-to-end encrypted chats?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
- When a user types a URL, show a preview within a second if possible.
- Same URL shared by many users should hit cache.
- Previews include title, description, site name and an image re-hosted on Meta...
High-Level Design
Client sends the URL to the preview service. It normalizes the URL, looks up a preview cache (key-value store with TTL). On miss, it enqueues a fetch to a sandboxed fetcher fleet outside t...