67 Data Modeling Interview Questions for Data Engineers

20 real questions from data engineer loops across 19 companies: Amazon, Netflix, Meta, Google, Snap, Capital One, Walmart, Wayfair, and 11 more. Each sits on the live schema canvas with a worked deep dive and the tradeoff the design turns on.

Last updated: Proudly published by: Jeff WahlVerified against 67 live modeling problems

The data modeling round is a 45-minute whiteboard exercise: you get a product (a marketplace, a card ledger, a subscription business) and a couple of analytical questions to support, and the interviewer watches which grain you pick, which attributes change over time, and whether you can defend the tradeoffs under pushback. These are 20 real questions from reported data engineer loops across 19 companies, Amazon, Netflix, Meta, Google, Snap, Capital One, Walmart, Wayfair, Stitch Fix, Bayer, and 9 more, ordered easy to hard. Each opens on the same schema canvas the round mirrors, with a worked walkthrough behind the reveal.

Design them here, or open any question's full problem page for the complete walkthrough. When you finish, the full catalog of 67 modeling problems continues with the same canvas.

20
questions solved on this page
67
modeling problems in the full catalog
19
companies represented
297
employers tagged across the catalog

What actually comes up in data modeling interviews

Computed from the 67 data modeling problems tagged by concept in our catalog, across the 23 employers they were reported from. Percentages are the share of those problems using each concept, so they overlap: a single question usually pulls in three or four at once.

ConceptShare of problemsEmployersWhat comes up
Surrogate and natural keys100% (67)23Why a warehouse issues its own keys instead of trusting a source system's.
Cardinality and junction tables99% (66)22Resolving many-to-many without fanning out every downstream aggregate.
Grain definition90% (60)20Stating what one row means before designing anything — the first question of every modeling round.
Fact and dimension tables81% (54)20Splitting measures from descriptors, and choosing the fact table's grain.
Star schema vs snowflake schema73% (49)19Denormalized dimensions for OLAP read speed vs normalized ones for write integrity.
Metric additivity64% (43)17Additive, semi-additive, and non-additive measures — why you cannot SUM a ratio.
Normalization and denormalization34% (23)111NF through 3NF, and the deliberate denormalization an analytics layer earns.
Slowly Changing Dimensions (SCD Type 2)22% (15)6Tracking history with valid_from / valid_to and a current-row flag instead of overwriting.
Event sourcing and immutable logs15% (10)5Append-only history as the source of truth, with state derived from it.
Late-arriving dimensions and facts4% (3)1Handling a fact whose dimension row does not exist yet.
Medallion architecture1% (1)0Bronze, silver, and gold layers and what each is allowed to assume.

Concept tags come from the same catalog that powers the practice problems, so this table moves as the catalog grows. Counts recomputed hourly.

The decisions data modeling interviews are won on

6 decisions cover most modeling rounds. Each maps to questions on this page.

DecisionThe senior answerOn this page
Fact grainOne row per what? Say it before drawing anythingQuestions 4, 11, 18
History: SCD typeType 2 with half-open effective dates when 'as of' appearsQuestions 1, 3, 8, 10, 20
Events versus stateAppend-only event facts; current state derived, never mutatedQuestions 2, 5, 12
Star versus normalizedConformed dimensions, surrogate keys, flatten the snowflakeQuestions 6, 11, 18
Late and re-arriving dataLocked attribution keys plus a stated restatement policyQuestion 13
Serving 2 access patternsCurrent-state table plus history table, same writerQuestions 7, 14
Bridges and many-to-manyA bridge with roles or allocation, never a repeated columnQuestions 9, 17, 19

Easy data modeling interview questions

The warm-up: one pattern, cleanly executed, with the boundary condition named unprompted.

Snap logo

1. The Person They Were Then

Asked in a Data Engineer interview by SnapEasy~20 minFull problem page
Task

We run a messaging app where a user's subscription tier and country both drift over time, and the ad-revenue team needs every past impression to reflect the tier and country the user actually had the moment it fired. Design the schema that lets analysts slice historical ad revenue by the profile state as of each event.

Show the solution
SELECT
    u.subscription_tier,
    u.country,
    d.month,
    SUM(f.revenue_usd) AS revenue
FROM fact_ad_impression f
JOIN dim_user u ON u.user_sk = f.user_sk
JOIN dim_date d ON d.date_key = f.date_key
WHERE d.full_date >= DATE '2025-01-01'
GROUP BY u.subscription_tier, u.country, d.month
ORDER BY revenue DESC

Intermediate data modeling interview questions

The core of the round: grain decisions, ledgers, SCD spines, and OLTP-to-star migrations.

Meta logo

2. The Shape of a Run

Asked in a Data Engineer interview by MetaMedium~30 minFull problem page
Task

Every machine in our fleet emits one log line when a process starts and a separate line when it stops, and each line records the machine, a process id the machine assigns locally, which kind of event it was, and a timestamp in float seconds. The warehouse has to keep every line exactly as it arrived so analysts can reconcile a start with its matching stop themselves, computing the average elapsed time per process, drawing per-machine timelines of every process in order, and flagging starts that never got a stop. Design the data model behind this log and describe how the daily files load in through an ETL.

Show the solution
WITH paired AS (
    SELECT
        s.machine_id,
        s.process_id,
        s.event_ts AS started_at,
        MIN(e.event_ts) AS ended_at
    FROM process_events s
    JOIN process_events e
      ON e.machine_id = s.machine_id
     AND e.process_id = s.process_id
     AND e.event_type = 'stop'
     AND e.event_ts > s.event_ts
    WHERE s.event_type = 'start'
    GROUP BY s.machine_id, s.process_id, s.event_ts
)
SELECT
    m.region,
    AVG(p.ended_at - p.started_at) AS avg_duration_sec
FROM paired p
JOIN machines m ON m.machine_id = p.machine_id
GROUP BY m.region
AstraZeneca logo

3. Crossing Over

Asked in a Data Engineer interview by AstraZenecaMedium~25 minFull problem page
Task

A pharmaceutical company runs multi-site clinical trials where a patient can move between treatment arms during the study, through crossover or a dose reduction. Design a schema for the safety team that stores adverse event reports and attributes every event to the arm the patient was actually on when the event was reported, so per-arm safety rates stay correct even after patients switch. The team also needs to reconstruct, for any date, which arm and dose a patient was on for audit.

Show the solution
Microsoft logo

4. Employee Application Time Tracking

Asked in a Data Engineer interview by MicrosoftMedium~25 minFull problem page
Task

We need to track how much time employees spend in each application. HR wants daily summaries of time-per-employee-per-application, and wants to flag any employee spending more than 10 hours/day in a single application. Design the schema to capture this data.

Show the solution
WITH clipped AS (
    SELECT
        s.employee_id,
        s.application_id,
        d.day,
        GREATEST(s.start_ts, d.day::TIMESTAMPTZ) AS clip_start,
        LEAST(COALESCE(s.end_ts, NOW()), (d.day + INTERVAL '1 day')::TIMESTAMPTZ) AS clip_end
    FROM app_sessions s
    CROSS JOIN LATERAL generate_series(
        DATE(s.start_ts),
        DATE(COALESCE(s.end_ts, NOW())),
        INTERVAL '1 day'
    ) AS d(day)
)
SELECT
    employee_id,
    application_id,
    day,
    SUM(EXTRACT(EPOCH FROM (clip_end - clip_start)) / 60) AS minutes_used
FROM clipped
GROUP BY employee_id, application_id, day
HAVING SUM(EXTRACT(EPOCH FROM (clip_end - clip_start)) / 3600) > 10
Capital One logo

5. The Float

Asked in a Data Engineer interview by Capital OneMedium~25 minFull problem page
Task

A card issuer needs a warehouse that reconciles what a cardholder can spend right now against what has actually posted to their account. Every swipe creates a temporary hold that later settles, often for a different amount and sometimes never, and a cardholder can dispute a charge after it posts. Model the schema that supports available-credit checks, statement generation, and dispute tracking across accounts that each belong to a customer.

Show the solution
SELECT
    a.account_key,
    a.credit_limit,
    COALESCE(posted.posted_balance, 0) AS posted_balance,
    COALESCE(holds.pending_balance, 0) AS pending_balance,
    a.credit_limit
      - COALESCE(posted.posted_balance, 0)
      - COALESCE(holds.pending_balance, 0) AS available_credit
FROM dim_accounts a
LEFT JOIN (
    SELECT account_key, SUM(posted_amount) AS posted_balance
    FROM fact_settlements
    GROUP BY account_key
) posted ON posted.account_key = a.account_key
LEFT JOIN (
    SELECT account_key, SUM(auth_amount) AS pending_balance
    FROM fact_authorizations
    WHERE auth_status = 'open'
      AND expires_at > NOW()
    GROUP BY account_key
) holds ON holds.account_key = a.account_key
WHERE a.account_key = 550142
Nintendo logo

6. The Retail Tables That Need a New Home

Asked in a Data Engineer interview by NintendoMedium~30 minFull problem page
Task

You are given an existing transactional database from a retail operation covering orders, customers, products, stores, and employees. The analytics team cannot write performant queries against this structure. Redesign it as a dimensional warehouse that supports reporting on sales performance, product mix, and customer behavior.

Show the solution
SELECT
    d.fiscal_week,
    s.region,
    p.category,
    SUM(f.quantity) AS units,
    SUM(f.extended_price) AS gross_sales
FROM fact_sales f
JOIN dim_date d ON d.date_key = f.date_key
JOIN dim_store s ON s.store_sk = f.store_sk
JOIN dim_product p ON p.product_sk = f.product_sk
GROUP BY d.fiscal_week, s.region, p.category
TikTok logo

7. Who Comes Back

Asked in a Data Engineer interview by TikTokMedium~25 minFull problem page
Task

We run a short-video social platform and the growth team wants to track how many new users come back on each day after they sign up, broken down by signup cohort and acquisition channel. Design the warehouse model that lets analysts compute day-N return rates for any offset they ask for later, without rescanning the raw event stream. Activity is high-volume, so the model has to keep these queries cheap as daily actives grow into the hundreds of millions.

Show the solution
SELECT
    u.signup_date,
    u.acquisition_channel,
    (d.full_date - u.signup_date) AS days_since_signup,
    COUNT(DISTINCT a.user_key) AS returning_users
FROM fact_user_daily_activity a
JOIN dim_users u ON u.user_key = a.user_key
JOIN dim_date d ON d.date_key = a.date_key
WHERE u.signup_date >= DATE '2026-01-01'
  AND d.full_date BETWEEN u.signup_date AND u.signup_date + 90
GROUP BY u.signup_date, u.acquisition_channel, (d.full_date - u.signup_date)
ORDER BY u.signup_date, days_since_signup
Walmart logo

8. Where They Used to Live

Asked in a Data Engineer interview by WalmartMedium~20 minFull problem page
Task

Customers move. We need to know their current address and their full address history, including when they moved in and moved out of each one. Design the schema.

Show the solution
Afterpay logo

9. Approval and After

Asked in a Data Engineer interview by AfterpayMedium~20 minFull problem page
Task

We run a consumer lending platform. A customer can apply many times, but each application follows one path: our risk team approves or declines it, an approval produces exactly one offer, and that offer is either accepted (funding a single loan) or left to lapse. Because a customer's credit profile drifts over time, the analytics team wants approval rates broken down by the segment the applicant was in when they applied. Design the data model.

Show the solution
SELECT
    CASE
        WHEN a.credit_score_at_apply >= 740 THEN 'prime'
        WHEN a.credit_score_at_apply >= 670 THEN 'near_prime'
        ELSE 'subprime'
    END AS tier,
    COUNT(*) AS applications,
    COUNT(*) FILTER (WHERE a.status = 'approved') AS approved,
    COUNT(f.funded_loan_id) AS funded
FROM loan_applications a
LEFT JOIN loan_offers o ON o.application_id = a.application_id
LEFT JOIN funded_loans f ON f.offer_id = o.offer_id
WHERE a.applied_at >= NOW() - INTERVAL '90 days'
GROUP BY tier
ORDER BY tier
PwC logo

10. The Rate That Was

Asked in a Data Engineer interview by PwCMedium~25 minFull problem page
Task

We run a professional services firm where consultants are staffed onto client engagements, often several at once, and log billable hours against each one. Rates change as consultants get promoted and as clients renegotiate terms, so any invoice we reissue for a past period has to bill at the rate that was in effect when the work was actually done. Design the schema that supports staffing, time logging, and invoice reconstruction.

Show the solution

Advanced data modeling interview questions

The senior tier: blank-page warehouses, state machines, late-arriving attribution, and dual access patterns, with the interviewer changing a requirement mid-design.

Amazon logo

11. Marketplace Sales Warehouse

Asked in a Data Engineer interview by AmazonHard~40 minFull problem page
Task

We run a two-sided marketplace where buyers and sellers transact. The analytics team needs a self-service warehouse to analyze GMV, conversion rates, and seller performance. There is no provided schema. You are expected to establish the entities, their relationships, and the dimensional model from scratch. Start by asking clarifying questions before designing anything.

Show the solution
SELECT
    c.category_name,
    u.region,
    SUM(f.price_at_sale * f.quantity) AS gmv,
    SUM(f.commission_amount) AS commission
FROM fact_transactions f
JOIN dim_user u ON u.user_sk = f.user_sk
JOIN dim_product p ON p.product_sk = f.product_sk
JOIN dim_category c ON c.category_sk = p.category_sk
JOIN dim_date d ON d.date_sk = f.date_sk
WHERE d.full_date >= DATE '2026-01-01'
GROUP BY c.category_name, u.region
ORDER BY gmv DESC
Netflix logo

12. The Churner Who Came Back

Asked in a Data Engineer interview by NetflixHard~30 minFull problem page
Task

We have a global subscription business with hundreds of millions of subscribers across multiple plan tiers and regions. Subscribers can upgrade, downgrade, pause, cancel, and re-subscribe. Finance and product analytics need a data model that supports churn analysis, revenue reporting, and plan mix reporting. Design the data model.

Show the solution
SELECT
    d.fiscal_period,
    p.tier,
    COUNT(DISTINCT s.subscriber_sk) AS active_subs,
    SUM(s.mrr_usd) AS mrr_usd,
    SUM(CASE WHEN s.end_reason = 'voluntary_churn' THEN 1 ELSE 0 END) AS churned
FROM fact_subscriptions s
JOIN dim_plans p ON p.plan_sk = s.plan_sk
JOIN dim_date d ON d.date_key = CAST(TO_CHAR(s.period_start_ts, 'YYYYMMDD') AS INT)
WHERE s.period_start_ts <= d.calendar_date
  AND (s.period_end_ts IS NULL OR s.period_end_ts > d.calendar_date)
GROUP BY d.fiscal_period, p.tier
Google logo

13. The Slow Yes

Asked in a Data Engineer interview by GoogleHard~30 minFull problem page
Task

A digital advertising platform needs an analytics warehouse for campaign reporting, where analysts slice impressions, clicks, and conversions by campaign, ad, device, geography, and day. Conversions can land days after the impression that drove them and must trace back to that exact impression so credit is never reassigned or double-counted, while every dashboard query scans wide date ranges on a columnar engine billed by bytes read. Design the schema.

Show the solution
Grab logo

14. The Heat of the Map

Asked in a Data Engineer interview by GrabHard~30 minFull problem page
Task

Grab's dispatch team runs a live map showing, for every geohash cell in a city, a surge multiplier driven by how far open requests outrun available drivers and a congestion score comparing observed speed to the road's free-flow speed, refreshed each minute. The schema backs both the always-on map, which needs only the current value in each cell, and analysts who replay how surge built up across a city over the past week. The cells nest, so a coarse cell's surge has to reconcile against the finer cells inside it and up to the one city each cell sits in, and you cannot get there by averaging one cell's ratio with another's.

Show the solution
Lyft logo

15. The Other Seat

Asked in a Data Engineer interview by LyftHard~25 minFull problem page
Task

We run a ride-hailing marketplace where the same person can sign up to drive and to ride, so the model has to capture both roles without splitting one human into two records. Design the entities for drivers, riders, vehicles, and the trips that connect them, knowing that every completed trip records the fare, the vehicle used, and a separate rating in each direction. A driver may switch vehicles between trips, and a person's displayed rating is the running result of every rating they have received.

Show the solution
CREATE TABLE dim_users (
    user_id    BIGINT PRIMARY KEY,
    full_name  TEXT,
    phone      TEXT,
    home_city  TEXT,
    signup_at  TIMESTAMPTZ
);

CREATE TABLE dim_vehicles (
    vehicle_id     BIGINT PRIMARY KEY,
    owner_user_id  BIGINT REFERENCES dim_users(user_id),
    make           TEXT,
    model          TEXT,
    plate          TEXT,
    seat_capacity  INT
);

CREATE TABLE dim_driver_profiles (
    user_id            BIGINT PRIMARY KEY REFERENCES dim_users(user_id),
    license_number     TEXT,
    current_vehicle_id BIGINT REFERENCES dim_vehicles(vehicle_id),
    status             TEXT,
    driver_since       DATE
);

CREATE TABLE dim_rider_profiles (
    user_id            BIGINT PRIMARY KEY REFERENCES dim_users(user_id),
    default_payment_id BIGINT,
    rider_since        DATE
);

CREATE TABLE fact_trips (
    trip_id          BIGINT PRIMARY KEY,
    driver_user_id   BIGINT REFERENCES dim_users(user_id),
    rider_user_id    BIGINT REFERENCES dim_users(user_id),
    vehicle_id       BIGINT REFERENCES dim_vehicles(vehicle_id),
    requested_at     TIMESTAMPTZ,
    completed_at     TIMESTAMPTZ,
    fare_amount      NUMERIC,
    surge_multiplier NUMERIC,
    rating_of_driver SMALLINT,
    rating_of_rider  SMALLINT
);
Meta logo

16. Content Engagement Data Model

Asked in a Data Engineer interview by MetaHard~40 minFull problem page
Task

We run a large social content platform. Creators publish posts (text, images, video). Users engage through views, reactions, comments, and shares. The product team needs a data model to power dashboards for content virality, creator performance, and feed ranking signals. Data visualization is also required. Sketch how a virality chart would query this model.

Show the solution
SELECT
    u.handle,
    SUM(h.views) AS views_24h,
    SUM(h.reactions) AS reactions_24h,
    SUM(h.shares) AS shares_24h,
    SUM(h.shares)::NUMERIC / NULLIF(SUM(h.views), 0) AS share_rate
FROM post_engagement_hourly h
JOIN posts p ON p.post_id = h.post_id
JOIN users u ON u.user_id = p.creator_id
WHERE h.hour_bucket >= NOW() - INTERVAL '24 hours'
GROUP BY u.handle
ORDER BY shares_24h DESC
LIMIT 50
Wayfair logo

17. Content Search and Discovery Schema

Asked in a Data Engineer interview by WayfairHard~40 minFull problem page
Task

We run a content platform where users can search for movies by title, by the actors who appeared in them, by the director, or by any other person who worked on the production. Design the data model to support multi-attribute search, and describe how you would build the architecture to support it.

Show the solution
SELECT
    t.name,
    t.release_year,
    STRING_AGG(DISTINCT g.genre_name, ', ') AS genres,
    STRING_AGG(DISTINCT ptr.role, ', ') AS roles
FROM titles t
JOIN person_title_roles ptr ON ptr.title_id = t.title_id
JOIN persons p ON p.person_id = ptr.person_id
LEFT JOIN title_genres tg ON tg.title_id = t.title_id
LEFT JOIN genres g ON g.genre_id = tg.genre_id
WHERE p.full_name = 'Tilda Swinton'
GROUP BY t.name, t.release_year
ORDER BY t.release_year DESC
Stitch Fix logo

18. The Schema That Could Not Answer Back

Asked in a Data Engineer interview by Stitch FixHard~35 minFull problem page
Task

A personal styling service tracks shipments in a single wide denormalized table with one row per shipment, repeating item attributes across numbered columns. The business wants to add return reasons, calculate client lifetime value, and attribute revenue by brand. The current table cannot answer these questions without significant ETL changes. Redesign it.

Show the solution
SELECT
    p.brand,
    SUM(si.price) AS gross_revenue,
    SUM(CASE WHEN si.was_kept THEN si.price ELSE 0 END) AS net_revenue,
    AVG(CASE WHEN si.was_kept THEN 1.0 ELSE 0.0 END) AS keep_rate
FROM fact_shipment_items si
JOIN fact_shipments s ON s.shipment_sk = si.shipment_sk
JOIN dim_product p ON p.product_sk = si.product_sk
JOIN dim_date d ON d.date_key = s.shipped_date_key
WHERE d.fiscal_month = '2025-03'
GROUP BY p.brand
Flipkart logo

19. The League With Too Many Loyalties

Asked in a Data Engineer interview by FlipkartHard~40 minFull problem page
Task

Design a data model for a sports tournament platform. The platform tracks multiple leagues, each with multiple teams. Players belong to teams, but can also represent national teams in separate competitions. Each match has two teams, takes place at a stadium, and produces per-player and per-team stats. Analytics need cumulative player scores across all matches in a tournament.

Show the solution
SELECT
    p.full_name,
    t.name AS tournament,
    SUM(s.goals) AS goals,
    SUM(s.assists) AS assists
FROM fact_player_match_stats s
JOIN players p ON p.player_id = s.player_id
JOIN matches m ON m.match_id = s.match_id
JOIN tournaments t ON t.tournament_id = m.tournament_id
JOIN player_team_memberships ptm
  ON ptm.player_id = s.player_id
 AND ptm.team_id = s.team_id
 AND m.kickoff_ts >= ptm.start_date
 AND (ptm.end_date IS NULL OR m.kickoff_ts < ptm.end_date)
WHERE t.tournament_id = 7
GROUP BY p.full_name, t.name
Bayer logo

20. The Territory That Keeps Moving

Asked in a Data Engineer interview by BayerHard~30 minFull problem page
Task

We are a pharmaceutical company that employs a field sales force selling prescription medications to healthcare providers. We need a data warehouse that tracks sales performance by rep, product, and territory, supports quota attainment reporting, and provides an auditable record of all sales interactions for compliance purposes. Design the data model.

Show the solution
SELECT
    r.rep_nk,
    p.therapeutic_area,
    SUM(q.actual_units) / NULLIF(SUM(q.quota_target), 0) AS attainment_ratio,
    SUM(i.transfer_of_value) AS compliance_tov
FROM fact_quota_attainment q
JOIN dim_reps r ON r.rep_sk = q.rep_sk
JOIN dim_products p ON p.product_sk = q.product_sk
LEFT JOIN fact_sales_interactions i
  ON i.rep_sk = q.rep_sk
 AND i.product_sk = q.product_sk
 AND i.interaction_ts >= q.period_start
WHERE q.period_start = DATE '2025-01-01'
GROUP BY r.rep_nk, p.therapeutic_area

Rapid-fire data modeling concept questions

The verbal layer of the round. Most of these have a 2-sentence answer and a follow-up hiding behind it.

What is the grain of a fact table and why does everyone start there?

The grain is what one row means: one order line, one impression, one state transition. Every other decision (which dimensions attach, which measures are additive, what double-counting looks like) derives from it. Interviewers open with grain because a wrong grain invalidates everything drawn after it.

SCD Type 1 versus Type 2, in one breath each?

Type 1 overwrites: current value only, history gone, fine for corrections. Type 2 versions: a new effective-dated row per change, so facts join to the value that was true at event time. The cue for Type 2 is any phrasing like 'as of', 'at the time', or 'history'.

What is the difference between a star schema and a snowflake schema?

A star schema denormalizes dimensions flat, so each one is a single table joined once. A snowflake schema normalizes them into sub-dimensions, trading extra joins for less duplication. Analysts and BI tools want stars: fewer joins, predictable query shapes, and better performance for OLAP analytical warehouses. The snowflake answer is occasionally right for very large, very duplicated dimension attributes, and saying that exception is what keeps the answer senior.

Fact table types beyond the transaction fact?

Periodic snapshots (balance per account per day), accumulating snapshots (one row per process instance with milestone dates that fill in), and factless facts (event occurred, nothing to measure). Recognizing an accumulating-snapshot prompt, like an order fulfillment pipeline, is a strong mid-level signal.

What makes a dimension conformed, and why bother?

The same dimension, same keys and attributes, shared across fact tables, so revenue by customer and support tickets by customer agree on who the customer is. It is the difference between a warehouse and a pile of marts. The cost is governance, which is why the follow-up asks who owns the dimension.

Surrogate keys or natural keys?

Surrogate keys in the warehouse, natural keys preserved as attributes. Source systems recycle ids, merge companies, and change formats; a surrogate key decouples the model from all of it and is what makes SCD Type 2 rows possible at all, since one natural key maps to many versions.

Where do degenerate dimensions fit?

An identifier with no attributes of its own (order number, ticket id) lives directly on the fact instead of a one-column dimension table. It exists so analysts can group and drill without a pointless join. Naming it correctly is a small, cheap signal of fluency.

How do you model many-to-many relationships in a dimensional model?

A bridge table with the two keys and, when weighting matters, an allocation factor so measures do not double-count. The canonical example is accounts to customers in banking. The follow-up probes whether you know the allocation rows must sum to 1 per fact.

How do you implement an SCD Type 2 pipeline?

Compare the incoming row against the current row for that natural key. If tracked attributes are unchanged, do nothing. If any changed, close the current row by setting valid_to to the change timestamp and is_current to false, then insert a new row with a fresh surrogate key, valid_from at the change timestamp, valid_to as NULL or a far-future sentinel, and is_current true. Wrap both writes in one transaction, and key the MERGE so a re-run is idempotent.

What is normalization, and what are 1NF, 2NF, and 3NF?

Normalization removes redundancy so an update happens in one place. 1NF requires atomic column values with no repeating groups. 2NF additionally removes partial dependencies, where a non-key column depends on only part of a composite key. 3NF removes transitive dependencies, where a non-key column depends on another non-key column. OLTP systems target 3NF; analytical layers denormalize back down on purpose.

When do you deliberately denormalize?

In the serving layer, when join cost at read time outweighs the redundancy cost at write time. A star schema's dimensions are denormalized precisely so a query joins once per dimension rather than walking a normalized chain. The condition that makes it safe is a single writer: the pipeline owns the table, so the duplicated attribute cannot drift the way it would with ad-hoc updates.

What is a slowly changing dimension Type 3, and when is it enough?

Type 3 adds a column instead of a row: current_value alongside previous_value. It captures exactly one prior state, so it is enough when the business only ever asks about before-and-after a single known reorganization, and it keeps the row count flat. It is wrong whenever full history matters, which is why Type 2 is the default answer.

What is a factless fact table?

A fact table with foreign keys but no numeric measures, recording that an event or a coverage relationship existed. Ad impressions are the canonical example: user, campaign, timestamp, and nothing to sum. You answer questions by counting rows or by checking absence against a coverage table, such as which products were on promotion but sold nothing.

What are additive, semi-additive, and non-additive measures?

Additive measures sum across every dimension, like revenue. Semi-additive measures sum across some but not time, like an account balance or inventory level, where the correct time aggregate is a snapshot or an average. Non-additive measures cannot be summed at all, like a ratio or a percentage, and must be recomputed from their numerator and denominator after aggregating those separately.

How do you handle late-arriving dimensions?

A fact lands whose dimension row does not exist yet. The standard answer is an inferred member: insert a placeholder dimension row with the natural key and unknown attributes, attach the fact to that surrogate key immediately, and let the real dimension load update the placeholder in place when it arrives. The alternative, parking the fact in a quarantine table, delays reporting and is usually the weaker choice.

What is a data vault and when would you choose it over a star schema?

Data vault splits the model into hubs (business keys), links (relationships), and satellites (descriptive attributes with history). It is built for auditability and for absorbing schema change from many source systems without remodeling. The tradeoff is many more joins, so it usually sits as an integration layer with star schemas built on top for consumption.

What is medallion architecture?

A layering convention: bronze holds raw ingested data as received, silver holds cleaned, deduplicated, conformed data, and gold holds business-level aggregates and dimensional models for consumption. Its value in an interview is that it forces you to say what each layer is allowed to assume, which is the same discipline as naming the grain.

What is a surrogate key and why not just use the natural key?

A surrogate key is a meaningless integer or hash the warehouse issues. It insulates you from source systems that reuse, reformat, or recycle their identifiers, it keeps joins narrow and fast, and it is required for SCD Type 2, where one natural key must map to several rows. Keep the natural key on the row as a unique-per-version attribute so lineage back to the source stays intact.

How do you choose a partition column for a large fact table?

Pick the column that most queries filter on, which is almost always an event date, so partition pruning eliminates most of the table. Then check cardinality: too fine and you get the small files problem, too coarse and pruning does not help. Never partition on a high-cardinality key like user_id, and never on a column that arrives late enough to force partition rewrites.

Getting interview-ready on data modeling

Four capabilities modeling rounds turn on, roughly in the order worth building them. For engineers who query warehouses daily but have not designed one under a clock.

  1. 01

    Make grain-first a habit

    Grain, facts, dimensions, star versus snowflake, surrogate keys. Sketch two familiar products (a coffee shop, a streaming service) and state the grain of every table out loud. Speed matters less than never drawing a table before you can say what one row is.

    • For every table you draw, write 'one row is one ...' before naming a single column.
    • Redo one design with a different fact grain and see exactly what breaks.
  2. 02

    Own history and change

    Type 1 versus Type 2 versus the rarely-right others, effective-dated rows, half-open intervals, current-row flags and partial indexes, as-of joins from facts. This is the modeling topic that appears most in reported loops.

    • Get fluent enough with the as-of join shape to write it without reference.
    • Model one entity 3 ways: overwrite, version, event log. Say when each is right.
  3. 03

    Design append-only, derive the rest

    Immutable event facts, derived current state, ledgers with reversing entries, accumulating snapshots for pipeline processes. The questions that separate senior candidates live here, and the principle never changes: never mutate, always derive.

    • Take a status column from your own systems and redesign it as an event stream.
    • For money, get to where the reversing-entry answer is instinct and UPDATE feels wrong.
  4. 04

    Defend a design under pushback

    Blank-page prompts inside 40 minutes: clarify, state the grain, draw, then hold your ground while the interviewer changes a requirement. The changed requirement is the round; the first diagram only earns you the right to it.

    • Have someone add a requirement mid-design, then amend rather than restart.
    • Close every run by naming the one tradeoff you would revisit with more time.

The mistakes that fail modeling rounds

From reported debriefs, these are the recurring failure modes, not notation slips.

Drawing before scoping

The prompt is deliberately underspecified. Candidates who ask two sharp questions (what counts in GMV, what does 'active' mean) before drawing consistently outperform. The blank-page Amazon question on this page turns almost entirely on the clarifying questions.

A status column where an event log belongs

Any entity with a lifecycle (subscriptions, orders, disputes) modeled as a mutable status column loses history and breaks every retroactive question. The reflex: append events, derive state.

Ignoring 'as of' language

When the prompt says attribution at the time of the event, the answer contains effective dates. Joining facts to a current-value dimension silently rewrites history, and interviewers plant exactly this.

One table for two access patterns

A live dashboard and an analyst backfill want opposite layouts. Split current-state from history and let one writer feed both. Forcing one table to serve both is the most common hard-question failure.

Over-normalizing the warehouse

Third normal form is an OLTP virtue. In the analytical model it multiplies joins and confuses BI tools. Denormalize dimensions, keep facts narrow, and say the word star before the interviewer does.

No answer for late or re-arriving data

Senior rounds always ask what happens when yesterday's data shows up today. If attribution keys are locked at write and aggregates have a stated restatement policy, the question answers itself.

How the modeling round runs

The interviewer gives you a product and one or two analytical needs, then goes quiet. The first two minutes decide the round: candidates who scope (who reads this, what questions, how fresh) and state the fact grain before drawing set the frame; candidates who start drawing boxes get framed by the interviewer's follow-ups instead.

Expect one requirement to change mid-round. A new attribution rule, a new access pattern, a regulatory hold. The rubric is whether your model absorbs the change with an amendment or collapses into a redesign, which is why append-only events and effective-dated dimensions keep winning: they absorb.

Notation matters less than candidates fear. Boxes and lines are fine; nobody fails for imperfect crow's feet. What fails is an unnamed grain, a mutable money column, or history handled with a shrug. The canvas on each question above mirrors the real round's medium, including the part where you have to commit to keys.

Prepare for the interview
01 / Open invite
02min.

Know the patterns before the interviewer asks them.

a data modeling query, the same shape a screen would give you.
The diff against expected. Where ties broke. What you missed.
sandbox
1fact_orders
2 order_id bigint PK
3 customer_sk bigint FK
4 order_date date SCD2
5
Execute your solution0.4s avg.
PinterestInterview question
Solve a problem

67 modeling problems on the canvas

These 20 are the company-tagged tier of a much larger set. The full modeling catalog has 67 problems from reported loops, from single-pattern warm-ups to blank-page warehouse designs, each on the same canvas with structural checks on keys, relationships, and grain.

When designs feel solved, interview mode runs the round the way an interviewer does: a vague product, a timer, pushback, and a verdict on the tradeoffs you defend.

Retailer Data Warehouse Design

> We're a mid-size e-commerce company processing about 10,000 orders per day. The analytics team needs to build dashboards for sales performance, customer segmentation, and product trends. Right now all the data lives in a normalized Postgres OLTP database and queries are slow. Can you design a dimensional model for the analytics warehouse?

+ Table
+ Column
PK
FK
Architecture
Data Modeling
Model the schema.

Click + Table in the toolbar, or right-click the canvas to add one.

Drag from a key column's edge dot to another column to draw a foreign key.

Data modeling interview questions: FAQ

Are these data modeling questions from real interviews?+
Yes. Questions come from interview reports submitted by data engineer candidates, rebuilt as canvas challenges. The company on each question names the employer it was reported from, and each carries the worked deep dive the problem page ships.
How often do data engineer loops include a modeling round?+
About 4 in 10 loops, rising sharply with seniority. Junior candidates mostly need facts-versus-dimensions fluency; senior candidates get the blank-page warehouse and the mid-round requirement change. Analytics engineer loops include it near-universally.
Kimball or Data Vault or One Big Table: which should I answer with?+
Kimball dimensional modeling is the interview lingua franca and the safe default. Name the alternatives when the prompt earns them: Data Vault for multi-source integration under heavy audit, wide tables when the engine and team make joins the bottleneck. Leading with an exotic methodology reads as evasion.
How much SQL DDL do I need to write in a modeling round?+
Usually none verbatim; boxes with named keys suffice. But you should be able to state key types, nullability of effective dates, and the partial unique index that enforces one current row, because senior interviewers probe exactly those seams.
What is the single highest-yield topic?+
SCD Type 2, end to end: when Type 2 versus Type 1, half-open effective dates, the as-of join, and enforcement of one current row. It appears in some form in most reported modeling rounds, and 3 questions on this page are built on it.
How do I practice a whiteboard round without a whiteboard?+
The canvas under each question is the same medium: tables, typed columns, keys, relationships, with structural checks. The part worth rehearsing out loud is the narration, because the round is a conversation with a diagram, not a diagram.
What clarifying questions should I ask before drawing?+
Who consumes it and through what tool, what the 2 or 3 concrete analytical questions are, how fresh it must be, and what the source systems emit. 2 sharp questions beat 6 generic ones; the Amazon blank-page question on this page hinges on this step.
How is the modeling round different from the pipeline design round?+
Modeling decides what the data looks like at rest: grain, keys, history. Pipeline design decides how it moves and recovers: ingestion, orchestration, replay, idempotency. Loops that include both usually probe the seam, like what a backfill does to your SCD rows.
02 / Why practice

Design the next one under interview conditions

  1. 01

    Reading a solution is not the same as writing one

    Every engineer who has frozen on a query they had read a dozen times knows the gap. The only preparation that closes it is producing the answer yourself, under time, before the interview does it for you

  2. 02

    76% of hiring managers reject on the coding task, not the resume

    From HackerRank's 2024 Developer Skills Report. Candidates who look strong on paper still fail the live screen if they haven't done timed, executable practice

  3. 03

    The round is won on tradeoffs, not on the diagram

    Grain, star vs snowflake, SCD type, conformed dimensions, late-arriving data. Modeling under live pushback is what separates the bands, and it is the half almost nobody rehearses

Keep going