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.

MediumTechnical
111 practiced
You have an events table:
sql
events(event_id PK, user_id nullable, anon_id, event_name, event_timestamp TIMESTAMP, properties JSON)
Write a SQL query (assume PostgreSQL) to compute Daily Active Users (DAU) for the last 30 days, counting a user once per day. Use user_id when present; otherwise use anon_id. Exclude events flagged as test in properties->>'is_test' = 'true'.
HardSystem Design
71 practiced
Design a canonical metrics layer (metric store) for the analytics team that will hold reproducible definitions (DAU, MAU, ARPU, Churn). Describe the core tables/views, versioning approach, documentation practices, and how analysts query it. Consider reproducibility, performance, and discoverability.
MediumTechnical
60 practiced
You receive two event ingestion streams for the same action: web_events and mobile_events. Each stream has event_id, user_id, device_id, timestamp, and properties. Define deduplication rules and a strategy to merge these streams into a single, canonical 'purchase' events table for accurate revenue and order-count metrics.
EasyTechnical
72 practiced
Explain the difference between event-level and user-level metrics. Provide examples when you would compute each, and describe a common SQL pattern to convert event-level rows (one row per click) into a daily user-level metric (one row per user per day).
MediumTechnical
71 practiced
Given the table:
sql
orders(order_id, user_id, order_amount, created_at TIMESTAMP, source)
Write a SQL query to compute Month-over-Month (MoM) revenue change (%) for the last 12 months. Show how you'd handle months with zero revenue to avoid division-by-zero errors and how you'd label months with partial data (current month incomplete).

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.