← Netflix Interview Insights

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

SeniorPrefer not to say
Apr 2026Remote

Summary

Netflix system design round, ads infrastructure focus. The question was dense and covered a lot of ground fast, felt like they wanted to see if you'd panic or actually structure your thinking under pressure.

Questions Asked (1)

Q1

Design a frequency capping system for ads that limits how often a user sees the same ad or campaign within configurable time windows like hourly, daily, and weekly. Walk through data modeling, counter storage choices, per-user and per-campaign cap policies, distributed counting accuracy, how it integrates with ad serving, and where you land on consistency vs latency.

System DesignTechnical Trade-offsData Modeling
Author's notes

This one sprawled.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then propose a data model that tracks per-user per-campaign counts across multiple time windows. Discuss storage options like Redis with TTL for low-latency counting, and address distributed accuracy with techniques like sharded counters or approximate counting. Finally, explain how the system integrates with ad serving, making explicit trade-offs between consistency and latency.

Pro tip: Emphasize that frequency capping is a best-effort system where slight over-serving is acceptable, so you can prioritize low latency and high availability over strict consistency. Mention Netflix's scale and the need for regional sharding to handle global traffic.

1. Clarify Requirements and Scale

Ask about expected QPS, number of users, campaigns, and time window granularity. Confirm that slight over-serving is tolerable, which influences consistency choices.

2. Design Data Model and Storage

Propose a key schema like user_id:campaign_id:window with counters. Choose a low-latency store like Redis with TTL for automatic expiry, and discuss sharding for scalability.

3. Handle Distributed Counting and Accuracy

Address race conditions and distributed counting using atomic increments, sharded counters, or approximate algorithms like count-min sketch. Discuss trade-offs between accuracy and performance.

4. Integrate with Ad Serving

Explain how the ad server checks caps before serving: fetch counts, compare against policies, and update counters asynchronously to avoid blocking. Consider caching and pre-fetching.

5. Discuss Consistency vs Latency Trade-offs

Argue for eventual consistency and low latency, since over-serving is acceptable. Mention fallback strategies if the counter store is unavailable, like serving ads without caps or using local caches.

Key Points to Mention

  • Use Redis with TTL for per-user per-campaign counters, enabling automatic expiry for hourly, daily, and weekly windows.
  • Shard counters by user or campaign to distribute load and avoid hot keys, especially for popular campaigns.
  • Employ atomic operations (INCR) or Lua scripts to handle concurrent increments accurately.
  • Consider approximate counting (e.g., count-min sketch) to reduce memory footprint at the cost of slight inaccuracy.
  • Integrate with ad serving via a fast lookup service that returns cap status; update counters asynchronously to minimize latency.
  • Prioritize availability and low latency over strict consistency, as over-serving is acceptable; use regional deployments to reduce latency.

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