Skip to content
tezvyn:
Menu

Design a Data Model for a Feature Adoption Dashboard

Source: Wikipedia: Dimensional modelingMediumHow cards are made

This tests your ability to translate a business need into a scalable star schema. A great answer defines a central fact table (e.g., fct_feature_usage) and its dimensions (dim_users, dim_features, dim_date).

What's really being asked

This question tests your ability to apply dimensional modeling (specifically, the star schema) to a real-world business problem. The interviewer is evaluating your thought process: how you identify the core business event, choose the right 'grain' for your fact table, and design dimensions that enable flexible slicing and dicing of data. It distinguishes candidates who understand analytical (OLAP) modeling from those who only know transactional (OLTP) database design.

The full answer

First, identify the business process and the core event to be measured, which is 'a user interacts with a feature'. This becomes the foundation for the fact table. Second, define the fact table, for example fct_feature_usage. State its grain clearly: one row per feature usage event. This table should contain quantitative, additive measures like usage_count (always 1) and foreign keys like user_key, feature_key, and date_key. Third, define the dimension tables needed to provide context. Examples include dim_users (with attributes like signup date, user segment), dim_features (with feature name, release date, category), and a standard dim_date table (with month, year, day of week). Fourth, explain why this star schema is efficient for a dashboard, highlighting simple joins and fast aggregations.

The mistakes people make

The most common mistake is proposing a single, wide, denormalized table containing all user and feature attributes on every event row. This is inefficient for storage and a nightmare to maintain when dimensional attributes change (e.g., a feature is renamed). Another red flag is describing a highly normalized (3NF) schema typical of an OLTP system. This is ill-suited for analytics because it requires many complex joins to aggregate data, leading to slow dashboard queries. Vague answers that just say 'a table for users and a table for events' without defining the grain, columns, and relationships also signal a lack of practical experience.

What usually comes next

Expect questions like: 'How would you handle slowly changing dimensions? For example, if a user's pricing plan changes?' (Discuss SCD Type 2). Or, 'This fact table will have billions of rows. How would you ensure performance?' (Discuss partitioning the fact table by date, creating aggregate summary tables, and using columnar storage formats like Parquet).

A concrete example

To calculate 'Weekly Active Users per feature', the query is simple and efficient: SELECT d.feature_name, w.week_start_date, COUNT(DISTINCT f.user_key) FROM fct_feature_usage f JOIN dim_features d ON f.feature_key = d.feature_key JOIN dim_date w ON f.date_key = w.date_key GROUP BY 1, 2;. This query's simplicity and performance directly result from the star schema design, which is the point you want to drive home.

Interview question

Which data model structure best supports fast, flexible analysis of feature usage events across different user segments for a dashboard?

  • a.A highly normalized (3NF) schema to eliminate data redundancy, requiring many complex joins for analysis.
  • b.A single, wide table where each row is a usage event containing all user and feature details.
  • c.A central fact table of usage events with keys linking to dimension tables for users, features, and dates.Correct
  • d.Two primary tables: one for all user data and another for all feature usage event data, joined by user ID.
Why?

This describes a star schema, which is ideal for analytics. The central fact table stores core events, while dimension tables provide context (who, what, when), enabling fast aggregations and simple joins. A single wide table is inefficient for storage and hard to maintain.

Just read this? Test yourself on what you have been reading.

Read the original → en.wikipedia.org

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on data modeling — each one lists the topics its interview covers.

See open roles