Propose a technical architecture for a centralized Metrics Layer.

This tests your grasp of data governance and semantic layers. A great answer outlines a system with a central definition store (e.g., YAML in Git), a query engine, and an API, ensuring all teams get consistent metric results.
What's really being asked
This question tests your ability to solve an organizational problem (inconsistent definitions) with a technical solution. It's not just about databases; it's about data governance and creating a single source of truth. The interviewer is looking for your understanding of modern data architecture patterns like a 'semantic layer' or 'headless BI'. They want to see if you can design a system that decouples business logic from underlying data sources and presentation layers, ensuring everyone speaks the same data language.
The full answer
A strong answer describes a system with four key components. First, a Data Connection Layer that can plug into various company data sources like data warehouses (Snowflake, BigQuery) and operational databases (Postgres). Second, the core component: a Semantic or Modeling Layer. This is where metrics are defined as code (e.g., in version-controlled YAML or Python files). A metric like 'active_user' is defined once here. Third, a Query Generation and Caching Layer that translates a request for a metric into the correct SQL, runs it against the appropriate data source, and caches results for performance. Fourth, an API Layer (e.g., GraphQL or REST) that exposes these consistent metrics to all consumers, from BI tools like Tableau to internal applications.
The mistakes people make
The most common mistake is proposing to build a new data warehouse. This doesn't solve the problem, as teams can still write their own conflicting queries against the new warehouse. Another red flag is focusing too much on a single tool (e.g., "We'll just use dbt") without explaining how its components fit into a larger architecture that enforces consistency. Proposing a non-technical solution, like a wiki page with approved SQL snippets, is also a weak answer because it's not scalable, versioned, or enforceable.
What usually comes next
Expect questions about implementation details. For example: "How would you handle versioning of metric definitions?" (A Git-based workflow with pull requests and CI checks). "What about performance for complex metrics?" (Caching strategies, pre-aggregation, or creating materialized views). "How would you drive adoption of this system?" (Demonstrate clear value, provide SDKs, and establish a clear deprecation path for old reporting methods). "Can you name any tools in this space?" (Cube.js, dbt, Looker's LookML, MetricFlow).
A concrete example
Imagine the Sales team defines an 'active user' as a login event, while Marketing includes newsletter opens. This can cause a 10-15% discrepancy in reports. The Metrics Layer solves this by creating a single, version-controlled file, active_user.yml. This file defines the metric's logic: COUNT(DISTINCT user_id) FROM (SELECT user_id FROM login_events UNION SELECT user_id FROM email_opens). Now, when any team requests the 'active user' metric through the API, the system generates this exact query, guaranteeing a consistent number across the entire company and eliminating reporting conflicts.
Interview question
A company's Sales and Marketing teams report conflicting numbers for the 'active users' metric. Which architectural approach most effectively solves this inconsistency at scale?
- a.Implement a semantic layer where metrics are defined as code in a version-controlled repository and exposed via a central API.Correct
- b.Mandate that all teams use a single, standardized BI tool, like Tableau, for all reporting and dashboarding.
- c.Create a shared wiki page with approved SQL snippets for key metrics that all analysts must copy for their reports.
- d.Consolidate all relevant data sources into a new, centralized data warehouse to serve as the single source of data.
Why? this is the answer
This approach creates a single, enforceable source of truth for the metric's business logic, ensuring consistency. A central data warehouse (D) is a common but incorrect solution, as it centralizes data but doesn't prevent teams from writing their own conflicting queries against it.
Just read this? Test yourself on what you have been reading.
Read the original → thenewstack.io
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
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.
We are hiring for this. Open roles that interview on data architecture — each one lists the topics its interview covers.
See open roles