← Snapchat Interview Insights

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

SeniorPrefer not to say
May 2026

Summary

System design round at Snapchat, basically a deep dive into how Stories works under the hood. Covered a lot of ground fast and I don't think I handled the fanout section as well as I should have.

Questions Asked (6)

Q1

Design Snapchat Stories: users post short photo/video clips visible to friends for 24 hours, then they disappear. Walk through your full system design.

System DesignTechnical Trade-offs
Author's notes

I started with requirements and that part went okay.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then design the core data model and storage strategy for ephemeral media, followed by the upload/viewing flows and expiration mechanism. Emphasize trade-offs around consistency, latency, and cost, and discuss how to handle scale and reliability.

Pro tip: Proactively discuss how you would handle the 'hot user' problem (e.g., a celebrity with millions of friends) and the trade-offs between push vs. pull for story delivery, showing you understand real-world scaling challenges.

1. Clarify Requirements and Scale

Ask questions to understand functional and non-functional requirements: number of users, daily active users, average friends per user, media size, view patterns, and consistency needs. Estimate scale (e.g., 100M DAU, 1B stories/day).

2. High-Level Architecture

Outline the main components: mobile clients, API gateway, media upload service, metadata service, story service, friend graph service, and expiration service. Sketch the flow from upload to viewing.

3. Data Model and Storage

Design how to store media (object storage like S3) and metadata (NoSQL like Cassandra for scalability). Discuss TTL for automatic expiration and indexing for fast retrieval of friends' stories.

4. Upload and Viewing Flows

Detail the upload process: client uploads media to a pre-signed URL, then metadata is written. For viewing, describe how to fetch friends' story metadata and then media, considering caching and CDN for low latency.

5. Expiration and Cleanup

Explain how stories expire after 24 hours: use TTL in the database and a background job to delete media from object storage. Discuss trade-offs between lazy deletion and scheduled cleanup.

Key Points to Mention

  • Use of object storage (e.g., S3) for media and NoSQL (e.g., Cassandra) for metadata to handle scale.
  • TTL-based expiration in the database and asynchronous deletion of media to manage storage costs.
  • Fan-out on write vs. fan-out on read for delivering stories to friends, and how to handle celebrities (hybrid approach).
  • Caching and CDN for media delivery to reduce latency and load on origin servers.
  • Consistency trade-offs: eventual consistency for story visibility vs. strong consistency for friend graph updates.
  • Monitoring and analytics: tracking views, expiration, and system health.

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

Q2

How would you handle media upload and delivery at scale for Stories?

System DesignTechnical Trade-offs
Author's notes

CDN was the obvious answer and I said it pretty quickly.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: scale, media types, latency, and cost constraints. Then design a pipeline that separates upload (ingest) from delivery (serving), using object storage, CDN, and asynchronous processing. Discuss trade-offs between consistency, availability, and cost, and how to handle failures and spikes.

Pro tip: Emphasize the importance of decoupling upload and processing with a message queue to handle bursts and enable retries, and mention using signed URLs for secure direct uploads to object storage to reduce server load.

1. Clarify Requirements

Ask about scale (daily uploads, concurrent users), media types (images, videos), latency requirements, and budget constraints. This ensures the design meets actual needs.

2. High-Level Architecture

Outline the main components: client, upload service, object storage, processing pipeline, CDN, and metadata database. Explain how they interact.

3. Upload Path Design

Detail how media is uploaded: use signed URLs for direct-to-storage uploads, chunked/resumable uploads for large files, and a message queue to trigger processing.

4. Processing and Storage

Describe asynchronous processing (transcoding, thumbnails, moderation) and storage tiers (hot vs. cold). Discuss metadata storage and indexing for fast retrieval.

5. Delivery and Scaling

Explain CDN usage for global low-latency delivery, caching strategies, and how to handle spikes with auto-scaling and rate limiting. Mention monitoring and failure handling.

Key Points to Mention

  • Use of object storage (e.g., S3) for durability and scalability
  • CDN for global distribution and reduced latency
  • Asynchronous processing with message queues (e.g., Kafka, SQS) for decoupling and retries
  • Signed URLs for secure direct uploads
  • Chunked/resumable uploads for large media files
  • Trade-offs: consistency vs. availability, cost vs. performance, and handling failures

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

Q3

How do you store story metadata with a 24-hour TTL, and what happens when stories expire?

System DesignData Modeling
Author's notes

Talked about using a key-value store with TTL set at write time.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: scale, read/write patterns, and consistency needs. Then propose a storage solution with TTL, such as a NoSQL database with TTL indexes or a cache with expiration, and explain the expiration process, including cleanup and potential data archival. Finally, discuss trade-offs and how to handle edge cases like delayed expiration and data recovery.

Pro tip: Mention that TTL enforcement is not instantaneous and can be delayed, so design your system to tolerate expired data being read briefly. Also, consider using a two-tier storage approach: hot storage with TTL for active stories and cold storage for archival if needed.

1. Clarify Requirements

Ask about scale (e.g., millions of stories per day), read/write ratio, latency requirements, and whether expired stories need to be archived or permanently deleted.

2. Choose Storage Technology

Select a database that supports TTL natively, such as DynamoDB with TTL, Cassandra with TTL, or Redis with expiration. Explain why it fits the requirements.

3. Design Data Model

Define the schema for story metadata, including fields like story_id, user_id, creation_time, media_url, and TTL. Consider indexing for efficient queries.

4. Explain Expiration Mechanism

Describe how TTL works: the database automatically deletes items after the TTL expires. Mention that deletion may be delayed and how to handle reads of expired items (e.g., filter by creation_time).

5. Discuss Trade-offs and Edge Cases

Talk about consistency, cost, and performance implications. Address edge cases like clock skew, delayed deletion, and whether to archive expired stories.

Key Points to Mention

  • TTL implementation options: native database TTL (DynamoDB, Cassandra), Redis expiration, or application-level cron jobs.
  • Data model considerations: partition key design for even distribution, and secondary indexes for querying by user or time.
  • Expiration behavior: TTL deletion is asynchronous and may not happen exactly at 24 hours; reads should filter out expired items.
  • Handling expired stories: whether to soft-delete (mark as expired) or hard-delete, and if archival is needed for analytics or compliance.
  • Scalability: how the chosen solution handles high write throughput and storage growth.
  • Monitoring and alerts: track TTL deletion metrics to ensure expired data is being removed.

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

Q4

For the friends' Stories feed, would you use a push or pull fanout model? Justify your choice.

System DesignTechnical Trade-offs
Author's notes

This is where I fumbled a bit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and scale of the friends' Stories feed, then compare push and pull fanout models in terms of latency, cost, and complexity. Recommend a hybrid approach that leverages push for active users and pull for others, and justify based on Snapchat's specific constraints like ephemeral content and large friend graphs.

Pro tip: Emphasize that the choice depends on read/write patterns and user activity distribution; mentioning a hybrid model shows you understand real-world trade-offs beyond textbook answers.

1. Clarify Requirements

Ask about scale (DAU, friends per user), latency requirements, and content ephemerality to ground your answer in Snapchat's context.

2. Define Push and Pull

Briefly explain push (write-time fanout to followers' feeds) and pull (read-time aggregation from friends' stories) models and their basic trade-offs.

3. Analyze Trade-offs

Compare push vs. pull on write amplification, read latency, storage cost, and complexity, considering Snapchat's large friend graphs and ephemeral content.

4. Propose a Solution

Recommend a hybrid approach: push for active users to ensure low latency, pull for inactive users to reduce write load, and explain how to handle ephemerality.

5. Justify and Summarize

Summarize why the hybrid model best balances Snapchat's needs for low latency, scalability, and cost-efficiency.

Key Points to Mention

  • Write amplification and its impact on system load
  • Read latency and user experience for a social feed
  • Storage and infrastructure costs of precomputing feeds
  • Handling ephemeral content (stories disappear after 24 hours)
  • Scalability with large friend graphs (hundreds of friends per user)
  • Hybrid approach: push for active users, pull for inactive users

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

Q5

How would you track which stories a user has already viewed, at scale?

System DesignData Modeling
Author's notes

Suggested storing view state in a fast read store keyed by user and story ID.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: scale (e.g., millions of users, billions of views), read/write patterns, latency needs, and consistency requirements. Then propose a data model and storage solution, such as a distributed key-value store with per-user sets of viewed story IDs, and discuss trade-offs like memory usage, TTL, and sharding. Finally, address scalability concerns like hot keys, replication, and caching.

Pro tip: Mention that you would use a probabilistic data structure like a Bloom filter or HyperLogLog to reduce memory footprint, but note the trade-off of false positives and the need for a fallback to exact storage for correctness. This shows you understand both efficiency and correctness at scale.

1. Clarify Requirements

Ask about scale (number of users, stories, views per day), read/write ratio, latency requirements, and consistency needs (e.g., is it okay to occasionally show a viewed story again?).

2. Data Model Design

Propose a data model: for each user, store a set of viewed story IDs. Consider using a key-value store like Redis or Cassandra, with user ID as the key and a set or sorted set of story IDs as the value.

3. Storage and Scalability

Discuss sharding by user ID to distribute load, replication for availability, and TTL to expire old views. Address memory constraints by using compact representations (e.g., bitmaps, Bloom filters) and tiered storage (hot vs. cold).

4. Read/Write Path

Explain how a view is recorded (write) and how the system checks if a story was viewed (read). Consider caching frequently accessed data and using asynchronous writes for high throughput.

5. Trade-offs and Alternatives

Compare exact vs. approximate tracking, discuss consistency vs. availability, and mention alternatives like using a graph database or a time-series database if access patterns are more complex.

Key Points to Mention

  • Sharding by user ID to distribute load and avoid hot spots
  • Using a distributed key-value store (e.g., Redis, Cassandra) for low-latency reads/writes
  • Memory optimization with probabilistic data structures (Bloom filters, HyperLogLog) and bitmaps
  • TTL and eviction policies to manage storage growth
  • Caching frequently accessed viewed sets to reduce database load
  • Trade-offs between consistency (exact tracking) and performance (approximate tracking)

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

Q6

How do you enforce privacy and visibility rules for Stories, for example close friends only vs all friends?

System DesignAPI & Integrations
Author's notes

Short answer: store an audience type on the story metadata and filter at read time, with the friends list checked against a separate social graph service.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: privacy rules are set per Story by the creator, and visibility must be enforced at read time for viewers. Then describe a system that stores audience rules as metadata, evaluates them at query time using an efficient index, and ensures consistency across services. Emphasize trade-offs between precomputation and real-time evaluation, and how to handle edge cases like friend list changes.

Pro tip: Mention that privacy enforcement should happen at the data access layer (e.g., in the API gateway or a dedicated authorization service) to avoid duplication and ensure consistency, and that you'd use a deny-by-default approach with explicit allow rules.

1. Clarify requirements and scope

Ask questions to understand the expected scale, latency requirements, and whether privacy rules can change after a Story is posted. Confirm that the core need is to enforce visibility based on the viewer's relationship to the creator.

2. Model privacy rules and relationships

Define how to represent audience rules (e.g., close friends list, all friends, custom lists) and how to store the creator-viewer relationship graph. Consider using a graph database or a friend list service with efficient lookups.

3. Design enforcement at read time

Describe how to evaluate visibility when a viewer requests a Story: fetch the Story's audience rule, check the viewer's relationship against that rule, and allow or deny access. Discuss caching and indexing to meet latency goals.

4. Handle updates and consistency

Explain how to handle changes to friend lists or privacy settings after a Story is posted. Consider whether to precompute visibility lists or evaluate dynamically, and how to invalidate caches.

5. Address scalability and edge cases

Discuss partitioning, sharding, and rate limiting. Cover edge cases like blocked users, deleted friends, and privacy rule changes mid-viewing. Mention monitoring and auditing for privacy compliance.

Key Points to Mention

  • Use of an authorization service or policy engine to centralize privacy logic.
  • Efficient data structures for friend lists (e.g., sets, bloom filters) and indexing for fast lookups.
  • Caching strategies (e.g., Redis) for audience rules and friend relationships, with appropriate TTL and invalidation.
  • Trade-offs between precomputing visibility (fan-out on write) vs. evaluating at read time (fan-out on read).
  • Handling of dynamic friend list changes and ensuring consistency across distributed systems.
  • Security considerations: deny by default, audit logs, and protection against unauthorized access.

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