Design tables from metrics
TikTokSoftware Engineer · Technical ScreenLast updated
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.
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.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.