Instrument, Define, and Validate Metrics for a New Feature
Statistics & ExperimentsModel answerLast updated
Design a measurement framework for a new product feature: pick a north-star and guardrails, plan instrumentation, derive KPIs from raw logs, and validate everything before stakeholders act on it.
Setting Up Measurement for a New Product Feature
Your team is about to launch a new feature — pick one you find interesting, or use the running example below. Your job is to build the full measurement layer around it: from deciding what success looks like, to making sure the numbers you report are actually correct.
Running example: a "Video Voicemail" feature inside a messaging app. Instead of typing a reply, a user records a short clip (≤ 30 s) directly inside the conversation thread. The recipient sees the clip inline and can react or reply in kind.
Work through each of the following areas. Interviewers expect concrete answers, not high-level hand-waving — name actual events, write representative SQL, and state your assumptions explicitly.
1. Goal alignment Before naming any metric, what clarifying questions would you ask? What assumptions are you making about why the feature exists and who it is for?
2. North-star and metric hierarchy Define one north-star metric that captures real two-sided value. Then name 3–5 driver metrics that decompose it into a funnel, 3–5 guardrail metrics that catch harm to adjacent product areas, and at least one counter-metric.
3. Instrumentation and tracking plan Sketch a tracking plan for the key events. For each event state: the trigger (client vs. server), required properties, join keys, and any schema-versioning concerns. What goes wrong if you log only on the client side?
4. Deriving KPIs from raw data Describe the pipeline from raw logs to the metric your stakeholders will read. Include a SQL sketch of the north-star. Call out the maturation delay and explain why you define ratios at the user level, not the event level.
5. Sanity checks List the specific checks you would run before declaring the metric trustworthy. Cover at least: reconciliation against a ground-truth source, funnel monotonicity, distribution checks, segment breakdowns, and how you would use dogfooding accounts.
6. Thresholds and alerting How do you set guardrail thresholds for an A/B test? How do you build an ongoing anomaly alert that is sensitive to real problems but does not page people at 2 a.m. for normal weekend dips?
7. Batch vs. streaming trade-offs How does the metric definition change if you need a near-real-time view (minutes of latency) versus a next-morning batch view? What caveats would you communicate to stakeholders about each?
What a strong answer looks like: it anchors every claim to the concrete feature, shows the funnel decomposition, writes defensible SQL, names realistic failure modes, and explains trade-offs rather than just listing best practices.
Hints
Hint 1
Start by asking why the feature exists — a metric that doesn't connect to a user need will mislead rather than guide. The north-star should require something to happen on both sides of the interaction, so a user can't inflate it by accident.
Hint 2
Instrumentation almost always breaks silently. Think about what happens on a crash mid-recording, an offline send, or a client retry — and explain why the server, not the client, is the source of truth for committed actions. Idempotent event IDs are your best friend for deduplication.
Hint 3
A metric is only final once its observation window has closed. A north-star that measures a 7-day downstream response can't be read on day 3 — build the concept of 'provisional' vs. 'final' into your pipeline design, and make sure your stakeholders know which version they're looking at.
Model answer
Hard Try it yourself first — then compare your approach, complexity and edge cases.
Approach
This question is really asking: can you take a feature from "we shipped it" to "we trust the number"? The answer has to stay concrete. Here is a full walkthrough using the Video Voicemail feature.
1. Clarify before measuring
Three questions worth asking before naming any metric:
- Why does this feature exist? The hypothesis here is that text replies in conversations feel effortful for some message types — reactions to good news, emotional check-ins — and a low-friction video format increases meaningful replies.
- Who is the intended user? Likely conversational senders who already view messages frequently but rarely initiate, not power creators.
- What is the decision context? A launch A/B test has different granularity and latency needs than an always-on health dashboard. State which you're designing for; ideally both.
2. Metric hierarchy
North-star: Weekly senders of a video voicemail whose clip is played to completion (≥80%) by the recipient within 48 hours.
This resists inflation: the sender can't game it without the recipient actually engaging. It moves weekly, so it fits experiment timelines.
Driver metrics (the funnel):
- Entry-point impression → tap-through rate
- Recording started → clip sent (completion rate)
- Clip sent → delivered → opened → played to ≥80%
- Recipient → reacts or sends a video reply in return
Guardrail metrics:
- Total conversation replies across all formats (text + video): catch cannibalization
- Session frequency and time-in-app for recipients: catch annoyance
- Mutes, blocks, and reports per 100 clips received: catch harassment
- Camera open latency p50/p95, upload failure rate, crash rate: catch performance regressions
Counter-metric: conversation initiation rate by the recipient in the following 7 days. If recipients feel the format is one-sided or awkward, they disengage from the thread entirely.
3. Instrumentation and tracking plan
For each key event, define trigger, properties, and join key:
| Event | Trigger | Key properties | Join key |
|---|---|---|---|
vv_entry_tapped | Client, button tap | user_id, thread_id, surface, client_ts, app_version | thread_id |
vv_recording_started | Client, camera stream opens | + session_id | session_id |
vv_clip_sent | Server, upload committed | clip_id, sender_id, recipient_id, server_ts, duration_ms | clip_id |
vv_clip_played | Client, playback ≥80% threshold crossed | clip_id, viewer_id, play_pct, client_ts | clip_id |
Why server for sends: clients drop events on crashes, network loss, or forced closes. If you log clip_sent only on the client, every delivery failure looks like a success. Server-side logging captures the ground truth of what was committed to the system.
Idempotent event IDs on every event make deduplication deterministic after retries. Log both timestamps: client_ts for behavioral analysis; server_ts for partitioning and late-arrival handling. Schema versioning: gate new properties behind app-version checks and document the date each field became reliable — you'll need this when a metric appears to drop after a rollback.
4. From raw logs to KPIs
Pipeline layers:
- Raw logs → cleaned/deduped table (deduplicate on event ID, remove test and employee accounts, filter bot signals)
- Cleaned events → fact table
fct_video_voicemail— one row per clip with sender, recipient, sent timestamp, and downstream play outcome joined in - Fact table → daily user-level aggregates
- Aggregates → central metric definitions consumed by dashboards and experiment platforms alike (so the logic is never duplicated)
North-star sketch:
WITH clips AS (
SELECT
f.sender_id,
f.clip_id,
f.server_ts AS sent_ts
FROM fct_video_voicemail f
WHERE f.server_ts >= :week_start
AND f.server_ts < :week_end
AND f.is_test_account = FALSE
),
engaged AS (
SELECT DISTINCT c.sender_id
FROM clips c
JOIN fct_clip_played p
ON p.clip_id = c.clip_id
AND p.viewer_id = c.recipient_id -- only counts if the right person watched
AND p.play_pct >= 80
AND p.played_ts < c.sent_ts + INTERVAL '48' HOUR
)
SELECT COUNT(DISTINCT sender_id) AS north_star_users
FROM engaged;
Two things to call out explicitly to stakeholders:
- Maturation delay: the 48-hour response window means the metric for day D is not final until day D+2. Always label which view is provisional.
- User-level ratios: completion rate = clips sent / recordings started, computed per user then averaged. Event-level computation lets heavy users (50+ clips/day) dominate the denominator and distort the rate.
5. Sanity checks before trusting the number
- Reconciliation: compare client
vv_clip_sentcount against the production DB row count of clip objects. A gap above ~3–5% (normal for failures) signals a logging issue. - Funnel monotonicity: impressions ≥ taps ≥ recordings started ≥ clips sent. Any inversion is a bug, not behavior.
- Distribution checks: null rate on required fields, duplicate clip IDs,
client_tsin the future, users with implausibly high send counts (>200/day). - Segment breakdown: split by platform and app version. A completion rate of 0% on iOS 17.4 means an instrumentation regression, not a UX problem.
- SRM check: in an A/B test, verify the split is actually 50/50 (or whatever was configured) before reading any metric.
- Dogfooding: send known clips from test accounts and verify the exact events land in the pipeline with the correct properties and timestamps.
6. Thresholds and alerting
For experiments: pre-register a minimum detectable effect on the north-star (typically 1–3% relative lift, depending on variance). For guardrails, set non-inferiority margins — for example, "total conversation replies must not decline more than 0.5%; report rate must not exceed 2× control." Apply CUPED to reduce variance, and correct the significance threshold for the number of guardrails being tested simultaneously.
For ongoing monitoring: don't alert on fixed absolute thresholds. Compare against the same weekday in prior weeks, fit a seasonality-aware forecast (e.g., ±3σ of residuals from a 4-week trailing model), and require the anomaly to persist for 2 consecutive intervals before paging. Add hard data-quality alerts separately: zero events for >30 minutes, null rate above 1%, or a sudden duplicate spike.
7. Batch vs. streaming trade-offs
| Dimension | Batch (next-morning) | Streaming (minutes latency) |
|---|---|---|
| Completeness | Full — late-arriving events included | Partial — window may close before all events land |
| Metric definition | Final, includes 48-hr play window | Provisional — play window not closed |
| Infrastructure cost | Low | High |
| Use case | Weekly reporting, experiment readouts | Launch monitoring, incident detection |
Communicate to stakeholders: the streaming dashboard is for "is something broken right now," not for measuring success. Feature-level A/B readouts should always use the batch, maturation-complete version. Mixing the two is one of the most common mistakes in practice and leads to teams declaring wins based on incomplete data.
Common mistakes to avoid
- Defining the north-star on sends alone — trivially inflated, measures nothing meaningful.
- Logging only on the client and wondering why numbers are 20% below production DB counts.
- Forgetting to exclude test and employee accounts from metric computation.
- Setting guardrail thresholds after seeing the data ("we'll call anything under 5% fine") rather than pre-registering them.
- Reporting a metric as final before its observation window has closed.