This was a lot to hold in your head at once.
Start by clarifying the business metrics and their required grains, then design a star schema with fact tables at the appropriate grains (e.g., order items for GMV, sessions for conversion) and conformed dimensions. Address data quality issues like late-arriving events, deduplication, and anonymous users by incorporating them into the ETL design and surrogate key strategy. Justify your choices by balancing query performance, storage, and maintainability.
Pro tip: Emphasize how you handle slowly changing dimensions (SCD) for sellers, especially Type 2, to track historical attribute changes and ensure accurate seller-level metrics over time. Also, mention partitioning by date and clustering by high-cardinality columns like category or seller_id to optimize query performance.
Identify each metric's calculation and the finest grain needed (e.g., order item for GMV, session for conversion). This determines the fact table design and avoids unnecessary joins.
Create fact tables for orders (order_id grain), order items (order_item_id grain), sessions (session_id grain), and page views (event_id grain). Include measures like quantity, price, and flags for cancellations.
Build dimensions for buyer, seller, product, category, date, and session. Use surrogate keys and handle SCD Type 2 for seller attributes to track changes over time.
Implement deduplication using event_id or natural keys, handle late-arriving events with partitioning and incremental loads, and manage anonymous users via a guest buyer dimension or session stitching.
Partition fact tables by date and cluster by high-cardinality columns (e.g., category, seller_id). Choose surrogate keys (e.g., monotonically increasing integers) for efficiency and join performance.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.