InterviewStack.io LogoInterviewStack.io

Metric Definition and Implementation Questions

End to end topic covering the precise definition, computation, transformation, implementation, validation, documentation, and monitoring of business metrics. Candidates should demonstrate how to translate business requirements into reproducible metric definitions and formulas, choose aggregation methods and time windows, set filtering and deduplication rules, convert event level data to user level metrics, and compute cohorts, retention, attribution, and incremental impact. The work includes data transformation skills such as normalizing and formatting date and identifier fields, handling null values and edge cases, creating calculated fields and measures, combining and grouping tables at appropriate levels, and choosing between percentages and absolute numbers. Implementation details include writing reliable structured query language code or scripts, selecting instrumentation and data sources, considering aggregation strategy, sampling and margin of error, and ensuring pipelines produce reproducible results. Validation and quality practices include spot checks, comparison to known totals, automated tests, monitoring and alerting, naming conventions and versioning, and clear documentation so all calculations are auditable and maintainable.

EasyTechnical
59 practiced
Explain tumbling (calendar-aligned), sliding (rolling) and session-based windows for metric aggregation. When would you choose a rolling 7-day average instead of month-to-date, and what pitfalls arise from timezones and daylight savings when computing daily metrics?
MediumTechnical
85 practiced
Write SQL to compute DAU, WAU, and MAU for the last 90 days from table events(user_id STRING, event_time TIMESTAMP, event_name STRING, ingestion_time TIMESTAMP). Deduplicate user activity per day using event_time normalized to UTC. Provide the SELECT query and discuss performance considerations and approximate alternatives for high cardinality.
EasyTechnical
84 practiced
Explain the difference between event-level and user-level metrics. Describe the steps to convert event-level data into user-level metrics (e.g., DAU, conversions per user) including deduplication, time-window choice, and sessionization pitfalls across devices.
MediumTechnical
74 practiced
Cohort SQL exercise: Given table events(user_id STRING, event_time TIMESTAMP, event_name STRING), write SQL to compute weekly cohorts and their 7-day retention rates. Output should be rows like cohort_week, users_in_cohort, day_0_active, day_1_retention, ..., day_7_retention. Explain edge cases (users with multiple first events).
EasyTechnical
67 practiced
Implement a conversion rate calculation in SQL. Given table user_events(user_id STRING, event_name STRING, event_time TIMESTAMP). Compute conversion_rate = unique users with event_name='purchase' divided by unique users with event_name='visit' over the last 30 days. Specify how you handle null user_id, duplicate events, and event_time boundaries.

Unlock Full Question Bank

Get access to hundreds of Metric Definition and Implementation interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.