PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/System Design/TikTok

Design tables from metrics

Last updated: Mar 29, 2026

Quick Overview

This question evaluates analytics data modeling and event-driven warehousing skills, including schema design, metric derivation, partitioning/clustering strategies, and data-quality concerns such as deduplication, late arrivals, and idempotency.

  • hard
  • TikTok
  • System Design
  • Software Engineer

Design tables from metrics

Company: TikTok

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Technical Screen

Given a business scenario and a list of required metrics, design the data model. Specify the tables you would create, each table's grain, columns (names, data types, nullability), primary and foreign keys, partitioning and indexing strategy, and how each metric would be computed from the schema. Discuss trade-offs (star vs. snowflake, denormalization, SCD handling) and data quality considerations.

Quick Answer: This question evaluates analytics data modeling and event-driven warehousing skills, including schema design, metric derivation, partitioning/clustering strategies, and data-quality concerns such as deduplication, late arrivals, and idempotency.

Related Interview Questions

  • Choose tools for scalable distributed systems - TikTok (medium)
  • Design a distributed key-value store - TikTok (medium)
  • Design a content moderation system - TikTok (medium)
  • Design low-latency large-scale hotel booking system - TikTok (medium)
  • Explain SRE architecture and troubleshooting scenarios - TikTok (hard)
TikTok logo
TikTok
Sep 6, 2025, 12:00 AM
Software Engineer
Technical Screen
System Design
2
0

Data Modeling Design Task: Short‑Video Social App Analytics

You are designing an analytics data model for a short‑video social application. The app supports:

  • Users and creators
  • Videos (short clips) with attributes (title, hashtags, language, category)
  • Events: impression, video_play_start, play_progress, play_complete, like, comment, share, follow, save/bookmark
  • Devices (OS, app version), and geo (country/region)

Assume events arrive in near real time from clients and services and land in a raw events stream with possible duplicates and late arrivals.

Required Metrics

Design for the following core metrics (computed daily unless noted):

  1. DAU, WAU, MAU (active = user with ≥1 play_start in window)
  2. Total video views (play_starts) and unique viewers per video
  3. Watch time: average watch time per view; average watch time per user per day
  4. Completion rate per video: play_completes / play_starts
  5. Engagement rate per video: (likes + comments + shares) / play_starts
  6. D1 and D7 user retention
  7. Creator follower count and daily follower growth
  8. Top‑K videos by watch time in a region for a day

Task

Propose an analytics‑oriented warehouse schema and describe:

  • Tables you would create, each table’s grain (one row = ?), columns (name, data type, nullability), primary keys, foreign keys
  • Partitioning and indexing/clustering strategy (assume a columnar cloud warehouse)
  • How each metric listed above is computed from the schema (include precise formulas or example SQL)
  • Trade‑offs: star vs. snowflake, denormalization choices, wide event table vs. multiple fact tables, SCD handling
  • Data quality: deduplication, late/out‑of‑order data, time zones, PII, referential integrity, bots/fraud, idempotency

State any additional assumptions you need. Keep the scope to core engagement (ignore ads and live streaming for this exercise).

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More TikTok•More Software Engineer•TikTok Software Engineer•TikTok System Design•Software Engineer System Design
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.