How would you design a BigQuery table for about 5 TB of daily event logs, balancing performance and cost?

Quick Overview

Asks how to lay out a BigQuery table that receives about 5 TB of event logs per day so queries stay fast and cheap. Tests partitioning and clustering choices, nested schema design, retention and storage pricing, and guardrails against full table scans.

How would you design a BigQuery table for about 5 TB of daily event logs, balancing performance and cost?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: hard

Interview Round: Other

How would you design a BigQuery table for a large volume of daily event logs (for example, 5 TB of new events per day), considering both query performance and cost? ```hint What a query pays for On-demand BigQuery bills by bytes read. List every mechanism that lets a query skip data it does not need. ``` ```hint Storage over time At this volume the table grows by about 150 TB a month. Think about what should happen to partitions that nobody reads or writes anymore. ``` ### Constraints & Assumptions - About 5 TB of raw event logs arrive per day. - Each event has a timestamp, a user, an event type and a variable set of properties. ### Clarifying Questions to Ask - What do most queries filter on: date ranges, event types, specific users? - How long must raw events be kept, and are there deletion requirements for user data? - How fresh must the data be: minutes after the event, or a daily batch? - How late can events arrive relative to their own timestamp? - Is the project on on-demand pricing or reserved slot capacity? ### What a Strong Answer Covers - The partitioning choice (event date or ingestion time) and how it keeps time-bounded queries cheap - Clustering columns and their order, tied to the real filter patterns - The schema shape for event properties, and query habits that keep bytes read low - Storage cost and retention: expiration, long-term storage pricing and guardrails against full scans - The ingestion path and how it affects cost, freshness and duplicates ### Follow-up Questions - Events can arrive up to three days late. How does that change your partitioning and storage cost? - A dashboard runs the same daily aggregate every five minutes. How would you cut its cost? - How would you make "all events for one user over the past year" fast and cheap? - How would you delete one user's events from this table to meet a privacy request?

Overview: Asks how to lay out a BigQuery table that receives about 5 TB of event logs per day so queries stay fast and cheap. Tests partitioning and clustering choices, nested schema design, retention and storage pricing, and guardrails against full table scans.

Nov 24, 2026
hardData ScientistOtherData Manipulation (SQL/Python)
0
0

How would you design a BigQuery table for a large volume of daily event logs (for example, 5 TB of new events per day), considering both query performance and cost?

Constraints & Assumptions

  • About 5 TB of raw event logs arrive per day.
  • Each event has a timestamp, a user, an event type and a variable set of properties.

Clarifying Questions to Ask Guidance

  • What do most queries filter on: date ranges, event types, specific users?
  • How long must raw events be kept, and are there deletion requirements for user data?
  • How fresh must the data be: minutes after the event, or a daily batch?
  • How late can events arrive relative to their own timestamp?
  • Is the project on on-demand pricing or reserved slot capacity?

What a Strong Answer Covers Guidance

  • The partitioning choice (event date or ingestion time) and how it keeps time-bounded queries cheap
  • Clustering columns and their order, tied to the real filter patterns
  • The schema shape for event properties, and query habits that keep bytes read low
  • Storage cost and retention: expiration, long-term storage pricing and guardrails against full scans
  • The ingestion path and how it affects cost, freshness and duplicates

Follow-up Questions Guidance

  • Events can arrive up to three days late. How does that change your partitioning and storage cost?
  • A dashboard runs the same daily aggregate every five minutes. How would you cut its cost?
  • How would you make "all events for one user over the past year" fast and cheap?
  • How would you delete one user's events from this table to meet a privacy request?