← Netflix Interview Insights

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

Senior
May 2026

Summary

Netflix system design round focused entirely on an ads frequency-cap service. The interviewer was pretty deliberate about separating the read and write paths, which ended up being the whole crux of the conversation. Solid problem but it goes deep fast.

Questions Asked (1)

Q1

Design an ads frequency-cap service that decides, given an ad request, whether a user has already seen a particular ad, campaign, or advertiser more than the configured cap within a time window. The read path (cap check at serve time) must hit sub-10ms p99, and the write path (impression logging) must be designed and scaled independently.

System DesignTechnical Trade-offsData Modeling
Author's notes

This question is deceptively big.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: what granularity (ad, campaign, advertiser), time windows, cap values, and scale. Then design a two-tier system: a fast in-memory read path (e.g., Redis or local cache) for cap checks, and an asynchronous write path (e.g., Kafka + stream processing) for impression logging. Discuss data modeling, consistency trade-offs, and how to handle hot keys and failures.

Pro tip: Emphasize that the read path must be sub-10ms p99, so precompute and cache counts per user per entity per window; use approximate counting (e.g., Redis HyperLogLog) if exact counts aren't critical, and consider local caching with eventual consistency to reduce latency.

1. Clarify Requirements and Scale

Ask about the number of users, ads, campaigns, advertisers, daily impressions, and the required accuracy of cap enforcement. Determine if caps are per user per ad/campaign/advertiser and the time windows (e.g., 1 hour, 1 day).

2. Design Data Model and Storage

Choose a key structure like user_id:entity_type:entity_id:window_start to store counts. Use a fast in-memory store (Redis) for read path, and a durable store (Cassandra, Bigtable) for write path and analytics.

3. Design Read Path for Low Latency

At serve time, check counts from Redis (or local cache) with a single multi-get. Use pipelining, connection pooling, and possibly local caching with short TTL to achieve sub-10ms p99. Handle cache misses by falling back to durable store or defaulting to allow.

4. Design Write Path for Scalability

Log impressions asynchronously to a distributed queue (Kafka). Consumers aggregate counts and update Redis and durable store. Use windowing (e.g., sliding windows) and batch updates to reduce load. Ensure idempotency to avoid double counting.

5. Address Trade-offs and Failure Modes

Discuss consistency vs. latency: eventual consistency may allow slight over-serving. Plan for Redis failures (fallback to local cache or allow all), hot keys (sharding by user), and data retention (TTL on keys).

Key Points to Mention

  • Use Redis or similar in-memory store for fast cap checks, with data structures like sorted sets or counters with TTL.
  • Asynchronous impression logging via Kafka to decouple write path and allow independent scaling.
  • Windowed counting: use sliding windows or fixed windows with TTL to expire old counts.
  • Idempotency and exactly-once processing to avoid over-counting due to retries.
  • Hot key mitigation: shard counters by user or use local caching with consistent hashing.
  • Fallback strategies: if cache is unavailable, default to allowing ads (to avoid revenue loss) or use a degraded mode.

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