Design an Image CDN for Instagram Feed Photos With Tiered Caches

Last updated: November 29, 2026

Quick Overview

Design how Instagram serves billions of feed photo requests per day through edge caches, regional caches, and origin storage, including choosing image sizes per device and keeping hit rates high.

Meta
System Design
Software Engineer
Meta
November 29, 2026
Software Engineer
System Design Round
System Design
Medium

0

0

0 solved


Design how Instagram serves billions of feed photo requests per day through edge caches, regional caches, and origin storage, including choosing image sizes per device and keeping hit rates high.

Photo delivery is core to Instagram, and Meta runs its own edge network, so this tests caching hierarchy reasoning at huge scale. The interviewer checks request routing to edge points of presence, cache key design for resized variants, hit rate and long-tail trade-offs, and protection of origin storage.

What the Interviewer Expects
  • Lay out edge PoP, regional cache, and origin tiers with their roles
  • Design cache keys that include size and format variants
  • Discuss popularity skew, long tail, and eviction policies
  • Use request collapsing to protect origin
  • Pick image formats and sizes per device and network
Key Topics to Cover
CDN tiers
cache keys
eviction policy
request collapsing
image variants
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • Where should resizing happen: at upload or on demand?
  • How would you improve hit rate for old photos that suddenly go viral?
  • How do you handle a photo deletion when copies sit in many caches?
  • How do you measure CDN performance from the client's view?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: clients request a photo by id and desired width; the CDN returns the best variant (WebP or AVIF where supported, JPEG fallback). Deleted or private photos must stop being served quickl...

High-Level Design

Clients receive photo URLs from the feed API, pointing at a CDN hostname. DNS or anycast routes them to the nearest edge PoP (including caches embedded in ISPs). Edge misses go to a **regional ori...


Submit Your Answer
Markdown supported