← Snapchat Interview Insights

Snapchat·Software Engineer·Onsite - System Design / Architecture·Senior

Senior
May 2026

Summary

Snapchat system design round focused entirely on the backend of a short-video feed, basically a TikTok-style recommendation pipeline. Pretty deep dive, they wanted real trade-off discussion not just a high-level sketch.

Questions Asked (4)

Q1

Design the backend feed-vending service for a short-video product like Snapchat Spotlight. The core API is getFeed(user_id, cursor, page_size) and it needs to return personalized, paginated video recommendations with metadata like CDN URLs, thumbnails, and captions.

System DesignAPI & IntegrationsTechnical Trade-offs
Author's notes

This is the main question and it ate the whole session.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale (DAU, QPS, latency, personalization depth), then design the API contract and data model before diving into the feed generation pipeline. Propose a layered architecture with a precomputed candidate pool, a lightweight ranking/scoring service, and a caching layer to meet low-latency pagination. Discuss trade-offs between freshness, personalization, and cost, and cover failure modes and monitoring.

Pro tip: Emphasize that cursor-based pagination must be stable and consistent under concurrent writes; use a snapshot or versioned cursor to avoid duplicates/skips. Also, precompute and cache feed pages for active users to reduce online ranking cost, but have a fallback for cold users.

1. Clarify Requirements and Scale

Ask about DAU, peak QPS, latency SLA, page size, personalization signals, and freshness requirements. Establish assumptions for the design.

2. Define API Contract and Data Model

Specify request/response schema, cursor semantics (opaque, versioned), and metadata fields (CDN URL, thumbnail, caption, etc.). Decide on cursor encoding (e.g., base64 of timestamp+video_id+version).

3. Design Feed Generation Pipeline

Outline candidate generation (e.g., from follow graph, trending, embeddings), ranking (ML model or heuristic), and filtering (dedup, safety). Consider precomputation vs. online ranking.

4. Address Pagination and Consistency

Explain how to handle pagination with a cursor: use a snapshot of the ranked list or a stable sort key. Discuss strategies for consistency (e.g., versioned cursors, read-your-writes).

5. Optimize for Latency and Scale

Propose caching layers (CDN for media, Redis for feed pages), sharding, and async precomputation. Discuss trade-offs between freshness and cost, and failure handling.

Key Points to Mention

  • Cursor-based pagination with opaque, versioned cursors to ensure stability and avoid duplicates/skips.
  • Precomputation of candidate pools and ranked feeds for active users to reduce online latency.
  • Caching strategy: CDN for video/thumbnails, Redis/Memcached for feed pages and metadata.
  • Personalization pipeline: candidate generation (follow graph, trending, embeddings) + ranking model.
  • Trade-offs: freshness vs. cost, personalization depth vs. latency, precompute vs. on-the-fly.
  • Failure modes: fallback to non-personalized feed, graceful degradation, monitoring and alerting.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

How would you handle de-duplication so users don't see videos they've already watched, both within a single session and over a longer time window?

System DesignTechnical Trade-offsData Modeling
Author's notes

Bloom filter was the obvious answer and I said it fast, but then they asked what happens when the filter gives a false positive and you skip a video the user actually hasn't seen.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scale and requirements, then propose a two-tiered approach: an in-memory cache for session-level deduplication and a persistent store (like a database or Redis) for long-term deduplication. Discuss trade-offs between accuracy, latency, and storage, and how to handle edge cases like cache eviction and eventual consistency.

Pro tip: Mention that you'd use a probabilistic data structure like a Bloom filter for long-term deduplication to save memory, but combine it with a fallback exact check to avoid false positives. This shows you understand the trade-offs between memory efficiency and accuracy.

1. Clarify Requirements

Ask about scale (number of users, videos, watch events per day), latency requirements, and whether deduplication should be exact or approximate. Also clarify if deduplication is per user or per device.

2. Design Session-Level Deduplication

For within a single session, use an in-memory data structure like a hash set or LRU cache to track watched video IDs. This is fast and simple, but ephemeral.

3. Design Long-Term Deduplication

For longer time windows, use a persistent store. Consider a key-value store like Redis with TTL for recent history, and a database for longer retention. Discuss sharding by user ID for scalability.

4. Address Trade-offs and Edge Cases

Discuss memory vs. accuracy (e.g., Bloom filters), cache eviction policies, handling multiple devices, and eventual consistency. Also consider how to handle new videos and resetting deduplication after a certain period.

5. Summarize and Conclude

Recap the proposed solution, emphasizing how it meets the requirements and handles scale. Mention monitoring and potential optimizations.

Key Points to Mention

  • Use of in-memory cache (e.g., Redis or local cache) for session-level deduplication with TTL.
  • Persistent storage (e.g., Cassandra, DynamoDB) for long-term deduplication, sharded by user ID.
  • Probabilistic data structures like Bloom filters to reduce memory footprint, with trade-offs on false positives.
  • Handling of multiple devices and cross-device deduplication, possibly using a centralized service.
  • Cache eviction policies (LRU, TTL) and their impact on user experience.
  • Scalability considerations: partitioning, replication, and latency.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

Walk through your CDN strategy for video delivery, including how you'd handle access control with signed URLs.

System DesignTechnical Trade-offs
Author's notes

Straightforward compared to the rest.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by outlining the high-level CDN architecture for video delivery, emphasizing scalability and low latency. Then dive into access control using signed URLs, explaining the signing process, validation, and security considerations. Finally, discuss trade-offs and how you'd handle edge cases like token expiration and revocation.

Pro tip: Mention that signed URLs should be generated server-side with short TTLs and include IP restrictions when possible, and highlight the importance of using a CDN that supports token authentication natively to avoid custom crypto at the edge.

1. Define CDN Strategy

Explain how you'd choose a CDN (e.g., multi-CDN for redundancy), configure caching rules for video segments (e.g., long TTL for popular content, shorter for live), and optimize for global low-latency delivery.

2. Design Access Control

Describe the signed URL mechanism: generate a URL with an expiration timestamp and HMAC signature using a secret key, and validate it at the CDN edge to grant or deny access.

3. Implement Signing and Validation

Detail the signing process (e.g., using a library like AWS CloudFront signed URLs or custom HMAC) and how the CDN validates the signature and expiration, including handling clock skew.

4. Address Security and Scalability

Discuss key management (rotating secrets), preventing hotlinking, and scaling signature generation with a stateless service. Mention using short TTLs and IP restrictions for sensitive content.

5. Evaluate Trade-offs

Compare signed URLs vs. signed cookies vs. token-based auth, and discuss trade-offs like added latency from validation, complexity, and cost of CDN features.

Key Points to Mention

  • Use of HMAC-SHA256 for signing URLs with a secret key
  • Short expiration times (e.g., 5-15 minutes) to limit exposure
  • CDN edge validation to avoid origin load
  • Handling token revocation via short TTLs or a revocation list
  • Multi-CDN strategy for redundancy and performance
  • Caching strategies for video segments (e.g., byte-range requests, adaptive bitrate)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

What are the trade-offs between a push-on-write feed (fan-out at upload time) versus a pull-on-read feed for this type of product?

System DesignTechnical Trade-offsProduct Strategy
Author's notes

I defaulted to the classic celebrity problem argument: push-on-write breaks for creators with millions of followers because you're writing to millions of feed caches on every upload.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the product context (e.g., Snapchat's ephemeral, social graph-heavy feed) and then compare push vs. pull across dimensions like latency, scalability, cost, and complexity. Conclude with a hybrid recommendation that leverages the strengths of both approaches, tailored to the product's specific access patterns and constraints.

Pro tip: Emphasize that the choice isn't binary—real-world systems often use a hybrid (e.g., push for active users, pull for inactive) and that the decision should be driven by metrics like fan-out ratio and read/write patterns. Show awareness of Snapchat's unique aspects, such as ephemeral content and close-friend networks, which can influence the trade-offs.

1. Clarify Product Requirements

Ask about the product's scale, user engagement patterns, and latency requirements to ground the discussion. For Snapchat, consider ephemeral content, friend graph size, and read-heavy vs. write-heavy patterns.

2. Define Push and Pull Models

Briefly explain push (fan-out on write) and pull (fan-out on read) with examples. Highlight that push precomputes feeds, while pull computes on demand.

3. Compare Trade-offs

Analyze trade-offs across key dimensions: latency (push is faster for reads), scalability (pull handles high fan-out better), cost (push uses more storage, pull uses more compute), and complexity (push requires robust write pipeline, pull requires efficient read aggregation).

4. Apply to Snapchat Context

Relate trade-offs to Snapchat's features: ephemeral stories, friend updates, and Discover content. Discuss how push might suit active users with small friend lists, while pull could handle celebrities or inactive users.

5. Propose Hybrid Solution

Recommend a hybrid approach, such as push for active users and pull for others, or using a write-ahead log with caching. Justify based on trade-offs and product goals.

Key Points to Mention

  • Latency: Push provides low-latency reads but can introduce write latency; pull offers low write latency but higher read latency.
  • Scalability: Push struggles with high fan-out (e.g., celebrity accounts) due to write amplification; pull handles high fan-out but may require complex read aggregation.
  • Cost: Push increases storage and write throughput costs; pull increases read compute and caching costs.
  • Complexity: Push requires a reliable, idempotent write pipeline; pull requires efficient merging and ranking at read time.
  • Hybrid approaches: Combining push and pull (e.g., push for active users, pull for inactive) can balance trade-offs.
  • Snapchat-specific factors: Ephemeral content reduces storage concerns for push; close-friend networks may limit fan-out, making push viable.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.