Data Modeling and Schema Design Questions
Designing relational schemas end to end: entity-relationship modeling, normal forms and deliberate denormalization, primary/foreign keys, data types, and integrity constraints, together with applied schema design driven by real business requirements and query access patterns. Covers modeling a domain from ambiguous requirements, choosing structures that serve the queries a system must run, trading normalization for correctness against denormalization for read performance, and evolving schemas as needs change. Foundational data-modeling judgment for building and reviewing databases, tested through open-ended domain-modeling prompts.
Design an event table schema suitable for session analysis, funnels, and attribution for a website or product analytics team. List the columns with suggested types, indicate the primary key, suggest a partitioning strategy, and name any indexes or clustering you'd recommend for the common queries.
Given this table definition (Postgres-like):
users(user_id INT PRIMARY KEY, signup_date VARCHAR(10), last_active TIMESTAMP, is_premium CHAR(1), lifetime_value NUMERIC(10,2))
Explain the potential issues with these datatype choices for analytics, list validations you would run before analysis, and recommend datatype changes or transformations you would apply before building dashboards.
Design an audit/change-log schema that lets you reconstruct any customer record's exact state as of a past point in time, for compliance investigations and debugging. Decide what each change-log entry needs to capture to make that reconstruction possible, propose the indexing needed to support lookups by entity and time range efficiently, and write an example query that reconstructs the state as of a given timestamp.
You are asked to design a schema for a real-time analytics dashboard that needs near-real-time metrics (within seconds) and supports ad-hoc drilldowns. Outline a hybrid architecture and schema choices to meet low-latency ingestion and flexible querying.
A BI team reports that joins between a large fact table and a high-cardinality dimension table are causing memory pressure on the analytic cluster. Propose schema-level and engine-level mitigations to reduce memory usage for large joins.
Unlock Full Question Bank
Get access to all Data Modeling and Schema Design interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.