What are the best practices for schema design in BigQuery for analytical workloads?

Quick Overview

Asks how to design BigQuery tables for analytical workloads on a columnar engine billed by bytes scanned. Tests nested and repeated fields, partitioning and clustering choices, data types, and shaping tables around the queries that run against them.

What are the best practices for schema design in BigQuery for analytical workloads?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Other

What are the best practices for schema design in BigQuery for analytical workloads? Assume the tables back dashboards and ad hoc analysis over large event and order data, and that queries are billed on demand by bytes scanned. ```hint What the bill counts Ask what BigQuery reads and charges for when a query runs, and which schema choices change that amount. ``` ```hint One-to-many data Think about how orders and their line items could live in a single table, and what that layout costs when a value inside it changes. ``` ### What a Strong Answer Covers - How columnar storage and bytes-scanned pricing shape the design - Denormalizing with nested and repeated fields, and when a separate dimension table is still the better choice - Partitioning and clustering: which columns, in what order, and how to make sure queries actually prune - Data type choices for money, dates and identifiers - Shaping tables, pre-aggregations or materialized views around the real query patterns ### Follow-up Questions - A dashboard query on a partitioned table still scans the whole table. What would you check? - Customer attributes are copied into every order row, and a customer's tier changes. How do you handle it? - When would you pick clustering alone over partitioning plus clustering? - Why would you migrate date-sharded tables such as `events_YYYYMMDD` to a single partitioned table?

Overview: Asks how to design BigQuery tables for analytical workloads on a columnar engine billed by bytes scanned. Tests nested and repeated fields, partitioning and clustering choices, data types, and shaping tables around the queries that run against them.

General logo
General
Nov 24, 2026
mediumData ScientistOtherData Manipulation (SQL/Python)
0
0

What are the best practices for schema design in BigQuery for analytical workloads?

Assume the tables back dashboards and ad hoc analysis over large event and order data, and that queries are billed on demand by bytes scanned.

What a Strong Answer Covers Guidance

  • How columnar storage and bytes-scanned pricing shape the design
  • Denormalizing with nested and repeated fields, and when a separate dimension table is still the better choice
  • Partitioning and clustering: which columns, in what order, and how to make sure queries actually prune
  • Data type choices for money, dates and identifiers
  • Shaping tables, pre-aggregations or materialized views around the real query patterns

Follow-up Questions Guidance

  • A dashboard query on a partitioned table still scans the whole table. What would you check?
  • Customer attributes are copied into every order row, and a customer's tier changes. How do you handle it?
  • When would you pick clustering alone over partitioning plus clustering?
  • Why would you migrate date-sharded tables such as events_YYYYMMDD to a single partitioned table?