← TikTok Interview Insights

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

SeniorPrefer not to say
Jun 2026

Summary

System design round at TikTok for a software engineer role, and they did not ease you in gently. The whole session was essentially one massive distributed systems question with about six sub-problems layered inside it.

Questions Asked (8)

Q1

Design a globally distributed notification service that handles real-time and scheduled messages across email, SMS, and push channels for tens of millions of users, while respecting regional data compliance requirements.

System DesignTechnical Trade-offsData Modeling
Author's notes

This is a beast of a question and I underestimated how much ground it covers.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then design a high-level architecture that decouples message ingestion, processing, and delivery. Focus on scalability, real-time vs. scheduled handling, and regional compliance through data partitioning and geo-distributed components.

Pro tip: Emphasize trade-offs between consistency, latency, and compliance, and propose a multi-region active-active setup with data residency controls. Show awareness of TikTok's scale by discussing sharding strategies and backpressure mechanisms.

1. Clarify Requirements and Constraints

Ask about scale (e.g., messages per second, user distribution), latency requirements, compliance regions, and channel-specific needs. Confirm real-time vs. scheduled message handling and delivery guarantees.

2. High-Level Architecture

Propose a layered architecture: ingestion API, message queue (e.g., Kafka), processing workers, and channel-specific delivery services. Include a scheduler for delayed messages and a global routing layer for region-aware delivery.

3. Data Modeling and Storage

Design schemas for user preferences, message templates, and delivery status. Use geo-distributed databases (e.g., Cassandra, DynamoDB) with region-specific partitions to comply with data residency laws.

4. Scalability and Reliability

Discuss sharding by user ID or region, horizontal scaling of workers, and idempotent processing. Implement retries, dead-letter queues, and monitoring for delivery failures.

5. Compliance and Trade-offs

Explain how to enforce data residency (e.g., EU data stays in EU) via regional clusters and legal holds. Discuss trade-offs between latency, consistency, and cost, and how to handle cross-region coordination.

Key Points to Mention

  • Decoupling via message queues for asynchronous processing and backpressure handling
  • Geo-distributed data storage with regional partitions for compliance (e.g., GDPR, CCPA)
  • Scheduler design for delayed messages using distributed timers or delay queues
  • Channel-specific adapters with rate limiting and provider failover
  • Idempotency and exactly-once delivery semantics to avoid duplicate notifications
  • Monitoring and alerting for delivery latency, failure rates, and compliance violations

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

Q2

How would you define the APIs and data models for this notification service?

API & IntegrationsData ModelingSystem Design
Author's notes

Went with a pretty standard send-notification endpoint and a scheduled-notification resource, nothing fancy.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the notification service's scope and requirements (e.g., types of notifications, scale, delivery channels). Then define the API endpoints and data models in a structured way, covering core entities, relationships, and operations. Finally, discuss trade-offs and how the design supports scalability and extensibility.

Pro tip: Show awareness of TikTok's scale and real-time nature by mentioning idempotency, rate limiting, and sharding strategies for the data models. Also, highlight how you'd version APIs to allow evolution without breaking clients.

1. Clarify Requirements and Scope

Ask questions to understand the notification types (push, email, SMS, in-app), expected volume, latency requirements, and delivery guarantees. This ensures your design meets actual needs.

2. Define Core API Endpoints

Outline RESTful or gRPC endpoints for sending, querying, and managing notifications (e.g., POST /notifications, GET /notifications/{id}, PUT /notifications/{id}/status). Include authentication, pagination, and error handling.

3. Design Data Models

Identify key entities like Notification, User, Device, Template, and DeliveryStatus. Define their fields, relationships, and indexes to support efficient queries and updates.

4. Address Scalability and Reliability

Explain how you'd partition data (e.g., by user ID), use queues for asynchronous processing, and implement retries and dead-letter queues for failed deliveries.

5. Discuss Trade-offs and Evolution

Talk about trade-offs between consistency and availability, and how you'd version APIs and migrate data models as requirements change.

Key Points to Mention

  • API design principles: REST vs. gRPC, idempotency, pagination, rate limiting
  • Data model entities: Notification, User, Device, Template, DeliveryStatus
  • Scalability: sharding, partitioning, asynchronous processing with message queues
  • Reliability: retries, dead-letter queues, idempotent delivery
  • Security: authentication, authorization, data privacy
  • Versioning and extensibility: API versioning, schema evolution

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

Q3

How do you handle deduplication and idempotency in a high-throughput notification pipeline?

System DesignTechnical Trade-offsAlgorithms & Data Structures
Author's notes

Mumbled something about a dedup table keyed on a client-generated request ID and TTL-based expiry.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scale and requirements (e.g., throughput, latency, delivery guarantees) and then propose a layered deduplication strategy: idempotent producers, deduplication at the ingestion layer using a unique message ID and a fast lookup store (e.g., Redis or Bloom filter), and idempotent consumers with exactly-once semantics. Discuss trade-offs between accuracy, latency, and cost, and how to handle failures and retries without duplicates.

Pro tip: Emphasize that deduplication should happen as early as possible in the pipeline to reduce downstream load, and that idempotency keys should be generated at the source to ensure end-to-end uniqueness. Also, mention that you'd monitor duplicate rates and adjust the deduplication window based on observed retry patterns.

1. Clarify requirements and constraints

Ask about expected throughput, latency SLAs, delivery guarantees (at-least-once vs exactly-once), and acceptable duplicate rate. This shapes the choice of deduplication techniques.

2. Design idempotent producers

Ensure each notification has a unique idempotency key (e.g., UUID or hash of content+recipient+timestamp) generated at the source, so retries produce the same key and can be deduplicated.

3. Implement deduplication at ingestion

Use a fast, scalable store like Redis with TTL or a Bloom filter to track recently seen keys. For high throughput, consider sharding the store and using probabilistic data structures to reduce memory footprint.

4. Ensure idempotent consumers

Make downstream processing idempotent by checking the deduplication store before sending, and use transactional writes or conditional updates to avoid duplicate side effects.

5. Handle failures and trade-offs

Discuss how to handle store failures (e.g., fallback to at-least-once with monitoring), the trade-off between deduplication window size and memory, and how to scale the deduplication layer horizontally.

Key Points to Mention

  • Unique idempotency keys generated at the source (e.g., UUID, content hash)
  • Deduplication store: Redis with TTL, Bloom filters, or Cassandra for persistence
  • Exactly-once semantics vs at-least-once with deduplication
  • Trade-offs: memory vs accuracy, latency vs cost, window size vs duplicate rate
  • Sharding and scaling the deduplication layer for high throughput
  • Monitoring and alerting on duplicate rates and store performance

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

Q4

What rate limiting strategy would you apply across different notification channels and user tiers?

System DesignTechnical Trade-offs
Author's notes

Token bucket per user per channel was my answer, which is correct enough, but I should have talked about a centralized rate limit service vs.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: notification types (push, email, SMS, in-app), user tiers (free, premium, VIP), and goals (prevent spam, ensure fairness, protect system). Then propose a layered rate limiting strategy that combines global, per-channel, per-tier, and per-user limits, using algorithms like token bucket or sliding window, and discuss trade-offs between strictness and user experience.

Pro tip: Emphasize the importance of configurability and monitoring: rate limits should be dynamic and adjustable via feature flags or a config service, and you should track metrics like throttled requests and user complaints to refine limits over time.

1. Clarify requirements and constraints

Ask about the notification channels (push, email, SMS, in-app), user tiers (free, premium, VIP), and business goals (e.g., engagement, retention, cost). Also consider system constraints like third-party API limits and delivery latency.

2. Define rate limiting dimensions

Identify the dimensions to limit: per user, per channel, per tier, and globally. For example, a free user might get 5 push notifications per day, while a VIP gets unlimited but still subject to global system limits.

3. Choose appropriate algorithms

Select algorithms like token bucket (for burst allowance), sliding window (for precise counting), or leaky bucket (for smoothing). Consider using a distributed rate limiter like Redis with Lua scripts for atomicity and scalability.

4. Design tiered and channel-specific policies

Propose specific limits per tier and channel, e.g., free: 10 push/day, 5 emails/day; premium: 50 push/day, 20 emails/day; VIP: 200 push/day, 100 emails/day. Also include global limits per channel to protect downstream services.

5. Discuss trade-offs and monitoring

Explain trade-offs: strict limits reduce spam but may hurt engagement; lenient limits risk user annoyance and cost. Highlight the need for monitoring, alerting, and dynamic adjustment based on metrics like delivery success rate and user feedback.

Key Points to Mention

  • Token bucket algorithm for allowing bursts while enforcing average rate
  • Distributed rate limiting using Redis or a dedicated service to handle scale
  • Tier-based quotas (free, premium, VIP) with different limits per channel
  • Channel-specific limits (e.g., SMS is costly, so stricter limits)
  • Global rate limits to protect downstream services and third-party APIs
  • Monitoring and dynamic configuration to adjust limits based on real-time data

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

Q5

Walk me through your choice of storage and queuing layers for this system.

System DesignTechnical Trade-offs
Author's notes

Went Kafka for the queue, Cassandra for notification state, Redis for dedup and rate limiting.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system's requirements (scale, consistency, latency, durability) and then justify your storage and queuing choices based on those requirements. Compare alternatives, explain trade-offs, and tie your decisions back to TikTok's specific use cases like high-throughput video feeds and real-time interactions.

Pro tip: Demonstrate awareness of operational complexity and cost by mentioning managed services (e.g., Kafka, S3, Redis) and how they reduce maintenance overhead while meeting SLAs. Also, proactively discuss how you would monitor and scale these layers.

1. Clarify Requirements

Ask about expected scale (QPS, data volume), consistency needs, latency targets, and durability requirements. This ensures your choices are grounded in the system's actual needs.

2. Propose Storage Options

Suggest appropriate storage solutions (e.g., relational, NoSQL, object storage, cache) and explain why they fit the requirements. Compare trade-offs like consistency vs. availability, and read/write patterns.

3. Propose Queuing Options

Recommend queuing systems (e.g., Kafka, RabbitMQ, SQS) based on throughput, ordering, delivery guarantees, and latency. Discuss how they integrate with the storage layer.

4. Justify Trade-offs

Explicitly state the trade-offs you're making (e.g., eventual consistency for scalability, at-least-once delivery for reliability) and why they are acceptable for this system.

5. Address Scalability and Operations

Explain how the chosen layers will scale (sharding, partitioning, replication) and how you'll monitor, maintain, and handle failures.

Key Points to Mention

  • CAP theorem and its implications for storage choices (e.g., CP vs. AP systems).
  • Data model and access patterns (e.g., key-value vs. document vs. wide-column).
  • Queuing semantics: at-least-once vs. exactly-once, ordering guarantees, and backpressure.
  • Caching strategies (e.g., Redis, Memcached) to reduce latency and database load.
  • Partitioning and replication for scalability and fault tolerance.
  • Managed services vs. self-hosted solutions: cost, operational overhead, and team expertise.

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

Q6

How would you orchestrate workers, handle retries with backoff, and preserve message ordering guarantees?

System DesignTechnical Trade-offsAlgorithms & Data Structures
Author's notes

Partition-per-user for ordering, exponential backoff with jitter for retries, dead-letter queues for poison messages.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: what ordering guarantees are needed (global vs. per-key), expected throughput, and failure modes. Then propose a partitioned queue architecture with idempotent workers, a retry mechanism using exponential backoff with jitter, and a dead-letter queue for poison messages. Finally, discuss trade-offs between strict ordering and scalability, and how to monitor and adjust the system.

Pro tip: Emphasize that strict global ordering limits scalability, so you'd use per-key ordering (e.g., by user ID) to balance consistency and throughput—this shows you understand real-world constraints at scale.

1. Clarify Requirements and Constraints

Ask about ordering scope (global vs. per-key), throughput, latency, and failure tolerance to tailor the design.

2. Design Orchestration with Partitioned Queues

Use a message broker (e.g., Kafka) with partitions keyed by entity ID to ensure per-key ordering, and a worker pool consuming from partitions.

3. Implement Retries with Exponential Backoff and Jitter

On failure, retry with exponential backoff plus jitter to avoid thundering herd, and cap retries before moving to a dead-letter queue.

4. Preserve Ordering with Idempotency and Sequencing

Ensure workers process messages sequentially per key, use idempotent operations to handle duplicates, and track offsets to avoid reprocessing.

5. Discuss Trade-offs and Monitoring

Acknowledge trade-offs (e.g., ordering vs. availability), and mention monitoring retry rates, DLQ size, and lag to detect issues.

Key Points to Mention

  • Partitioned queues (e.g., Kafka partitions) for per-key ordering and scalability
  • Exponential backoff with jitter to prevent retry storms
  • Idempotent message processing to handle duplicates from retries
  • Dead-letter queue for poison messages and manual intervention
  • Worker orchestration: consumer groups, offset management, and rebalancing
  • Trade-offs: strict ordering vs. throughput, and how to choose based on requirements

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

Q7

How would you design multi-region failover and disaster recovery for this notification service?

System DesignTechnical Trade-offs
Author's notes

Active-active with regional primaries was my pitch.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the service's requirements—SLA, RPO, RTO, and data consistency needs—then propose a multi-region active-active or active-passive architecture with clear failover mechanisms. Walk through the design step by step, covering data replication, traffic routing, failure detection, and trade-offs between consistency, latency, and cost.

Pro tip: Emphasize that failover must be tested regularly and automated; mention that TikTok's global user base demands low-latency notifications, so consider edge caching and regional autonomy to avoid cross-region dependencies during failures.

1. Clarify Requirements and Constraints

Ask about expected notification volume, latency requirements, RPO/RTO targets, and consistency needs (e.g., can notifications be delayed or lost?). This sets the stage for design decisions.

2. Choose a Multi-Region Topology

Decide between active-active (both regions serve traffic) and active-passive (one standby). Discuss trade-offs: active-active offers lower latency and better resource utilization but requires conflict resolution; active-passive is simpler but may have higher RTO.

3. Design Data Replication and Consistency

Explain how to replicate notification data (e.g., user preferences, message queues) across regions. Consider synchronous vs asynchronous replication, and how to handle conflicts (e.g., last-write-wins, CRDTs).

4. Implement Traffic Routing and Failover

Describe global load balancing (e.g., DNS-based, Anycast) with health checks to detect region failures. Detail automatic failover: reroute traffic to healthy regions, and ensure idempotent processing to avoid duplicate notifications.

5. Address Monitoring, Testing, and Cost

Outline monitoring for region health and replication lag, regular failover drills, and cost implications. Discuss how to handle partial failures (e.g., a single service in a region) and degrade gracefully.

Key Points to Mention

  • RPO/RTO definitions and how they influence replication strategy (sync vs async).
  • Active-active vs active-passive trade-offs: latency, cost, complexity, and consistency.
  • Data replication techniques: multi-leader, leader-follower, and conflict resolution (e.g., version vectors, CRDTs).
  • Traffic management: DNS failover, Anycast, global load balancers, and health checks.
  • Idempotency and deduplication to prevent duplicate notifications during failover.
  • Regular failover testing (game days) and monitoring for replication lag and region health.

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

Q8

Provide rough capacity estimates and describe your monitoring and alerting strategy for this system.

System DesignProduct Analytics & Metrics
Author's notes

Back-of-envelope math: tens of millions of users, peak notification bursts around product events, worked out to something like 50k messages per second at peak.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system's scope and key user flows, then walk through a structured capacity estimation using assumptions and simple math. Follow with a monitoring and alerting strategy that covers metrics, logging, tracing, and alerting principles, emphasizing actionable alerts and continuous improvement.

Pro tip: Tie capacity estimates to TikTok's scale (e.g., millions of concurrent users) and highlight how monitoring feeds back into capacity planning, showing you understand the full lifecycle. Also, mention specific tools like Prometheus and Grafana to demonstrate hands-on experience.

1. Clarify Requirements and Scope

Ask clarifying questions to understand the system's functionality, expected user base, and key performance indicators. Define the boundaries of what you'll estimate and monitor.

2. Estimate Capacity with Assumptions

Break down the system into components (e.g., API servers, databases, caches) and estimate QPS, storage, and bandwidth using assumptions about daily active users, requests per user, and data size. Show your math.

3. Define Monitoring Metrics and Tools

Identify key metrics to monitor: latency, error rates, throughput, resource utilization, and business metrics. Mention tools like Prometheus for metrics, ELK for logs, and Jaeger for tracing.

4. Design Alerting Strategy

Explain how to set thresholds and alerts based on SLOs, using techniques like anomaly detection and multi-window burn rates. Emphasize reducing alert fatigue by prioritizing actionable alerts.

5. Iterate and Improve

Describe how monitoring data informs capacity planning and system improvements, including regular reviews and post-mortems to refine estimates and alerts.

Key Points to Mention

  • Back-of-the-envelope calculations with clear assumptions (e.g., DAU, requests per user, data size).
  • Use of percentiles (p50, p95, p99) for latency monitoring instead of averages.
  • SLOs and error budgets to drive alerting thresholds.
  • Specific tools: Prometheus, Grafana, ELK stack, Jaeger, PagerDuty.
  • Alerting best practices: actionable alerts, runbooks, and on-call rotation.
  • Capacity planning feedback loop: using monitoring data to adjust estimates.

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