Design a Warehouse for Key Metrics
TikTokData Engineer · Technical ScreenLast updated
This question evaluates a data engineer's skills in dimensional modeling, data warehousing, and analytics infrastructure, covering facts and dimensions, grain definition, surrogate keys, partitioning and clustering strategies, and operational concerns like deduplication, late-arriving events, null/anonymous users, and slowly changing dimensions.
Given an e-commerce marketplace with buyers, sellers, orders, order_items, payments, and page_view events, design a data warehouse model to compute: (
- daily session-to-purchase conversion rate, (
- average order value, (
- 7-day buyer retention by signup cohort, (
- cancellation rate by seller, and (
- daily GMV by category. Specify the tables you would create (fact and dimension), the grain of each table, key columns (primary/foreign keys), important attributes and data types, partitioning and clustering strategy, and how you would handle late-arriving events, deduplication, null/anonymous users, and slowly changing seller attributes. Justify star vs. snowflake choices and any surrogate keys. No SQL is required.
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.