← Netflix Interview Insights

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

SeniorPrefer not to say
Jun 2026

Summary

Netflix system design round focused entirely on a frequency-capping service for ads. Solid problem with a lot of moving parts, and I felt like I was playing catch-up for most of it.

Questions Asked (1)

Q1

Design a frequency-capping service for an advertising platform, where each cap limits a user to at most N impressions for a given ad scope within a rolling time window.

System DesignTechnical Trade-offsData Modeling
Author's notes

I started with the read path because that felt most urgent, deciding whether to show an ad, and worked backward from there.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: define the ad scopes (e.g., campaign, creative), the rolling window (e.g., 24 hours), and the cap N. Then propose a scalable, low-latency design using a distributed store like Redis with sorted sets or counters, and discuss trade-offs between accuracy, latency, and cost. Finally, address edge cases like clock skew, hot keys, and failure modes.

Pro tip: Emphasize the need for a rolling window rather than fixed windows to avoid boundary effects, and mention using approximate counting (e.g., Redis sorted sets with TTL) to balance precision and performance at Netflix scale.

1. Clarify Requirements and Scope

Ask questions to pin down ad scopes (e.g., per campaign, per creative), the rolling window duration, the cap value N, and expected QPS. Also clarify consistency requirements (strict vs eventual) and latency SLOs.

2. Design Data Model and Storage

Choose a data model: for each user and ad scope, store a timestamped list of impressions. Use a distributed store like Redis with sorted sets (ZADD) and TTL to automatically expire old entries. Discuss sharding by user ID to distribute load.

3. Implement Frequency Capping Logic

On each ad request, check the count of impressions within the rolling window. If count < N, allow and record the impression; else, deny. Use atomic operations (e.g., Lua scripts in Redis) to avoid race conditions.

4. Address Scalability and Reliability

Discuss scaling: shard by user, use read replicas, and consider approximate counting (e.g., HyperLogLog) if exact counts are too costly. Handle failures with fallbacks (e.g., allow if store is down) and monitor hot keys.

5. Evaluate Trade-offs and Optimizations

Compare exact vs approximate counting, in-memory vs persistent storage, and synchronous vs asynchronous updates. Mention optimizations like local caching, batching, and pre-aggregation for high-traffic users.

Key Points to Mention

  • Rolling window implementation using sorted sets with timestamps and TTL
  • Sharding strategy by user ID to distribute load and avoid hot spots
  • Atomic operations (Lua scripts) to prevent race conditions in check-and-increment
  • Trade-offs between exact counting (memory-heavy) and approximate counting (e.g., HyperLogLog)
  • Handling clock skew and time synchronization across distributed nodes
  • Failure modes: what happens if the frequency cap store is unavailable (fail-open vs fail-closed)

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