← Back to All Questions
Medium~45 minStorage Systems

Design Photo Sharing Service

Google PhotosAppleAmazonFlickrSmugMug

📝 Problem Description

Design a photo sharing service like Google Photos or Flickr. Users can upload, organize, search, and share photos. Focus on efficient storage, fast retrieval, and intelligent features like auto-organization and search.

👤 Use Cases

1.
User wants to uploads photos so that photos stored and processed
2.
User wants to searches "beach vacation" so that finds relevant photos
3.
User wants to creates shared album so that friends can view/add photos
4.
System wants to processes photo so that extracts metadata, generates thumbnails, runs ML

✅ Functional Requirements

  • Upload photos and videos
  • Organize into albums
  • Search by text, date, location, people
  • Auto-categorization (places, things, people)
  • Share albums with others
  • Download originals
  • View on multiple devices

⚡ Non-Functional Requirements

  • Upload: Complete in < 10 seconds for 10MB photo
  • Thumbnail load: < 100ms
  • Search: < 500ms
  • Storage: Unlimited (with compression)
  • 99.99% durability (never lose photos)

⚠️ Constraints & Assumptions

  • Original quality must be preserved
  • EXIF metadata extraction required
  • ML processing for search features
  • Storage costs must be optimized

📊 Capacity Estimation

👥 Users
100M users, 1B photos uploaded/day
💾 Storage
100 PB total (originals + processed)
⚡ QPS
Uploads: 12K/sec, Views: 100K/sec
🌐 Bandwidth
10 PB/day (uploads + downloads)
📐 Assumptions
  • 100M active users
  • Average 10 photos/day per user
  • Average photo size: 5MB
  • Store original + 3 sizes = 8MB total

💡 Key Concepts

CRITICAL
Async Processing
Upload returns immediately; thumbnails and ML run in background.
HIGH
Tiered Storage
Hot photos in standard S3, old photos in S3 Glacier for cost savings.
HIGH
Vector Search
ML embeddings enable semantic search ("beach sunset" finds relevant photos).
MEDIUM
EXIF Extraction
Extract date, location, camera info from photo metadata.

💡 Interview Tips

  • 💡Start with the upload and processing pipeline
  • 💡Discuss the CDN architecture for delivery
  • 💡Emphasize the async processing pattern
  • 💡Be prepared to discuss image optimization
  • 💡Know the storage hierarchy (hot/warm/cold)
  • 💡Understand the ML integration for features