Google BigQuery Architecture, Analytics & FinOps Master Interview Bank
BigQuery serverless architecture (Dremel, Capacitor, Jupiter), partitioning, clustering, slot reservations, Storage Write API, BigLake, BQML, and FinOps.
Curriculum Roadmap & Learning Path
3 StagesPart 1: Serverless Architecture, Storage & Ingestion (1 - 10)
10 QuestionsExplain Google BigQuery's Serverless Architecture: Dremel, Capacitor, and Jupiter?
Compute Engine (Dremel): Massively parallel query execution engine that turns SQL into multi-stage execution trees • Storage Engine (Capacitor): Columnar, compressed storage system designed for high scan throughput.
How does Table Partitioning work in BigQuery and what partitioning types are supported?
Partitioning divides a table into segments based on a key column. Queries filtering by partition key scan only relevant partitions, slashing query cost and latency.: Ingestion-Time: Partitioned by data arrival date (PARTITIONDATE) • Date/Timestamp Column: Partitioned by a column (e.g., eventtimestamp).
Compare Table Partitioning vs Table Clustering in BigQuery?
Partitioning: Coarse-grained division (max 4,000 partitions) • Clustering: Fine-grained sorting of rows within partitions (up to 4 columns).
Explain BigQuery Slot Architecture and the difference between On-Demand and Editions Pricing?
A Slot is a virtual CPU and RAM unit used by BigQuery to execute SQL queries.: On-Demand Pricing: Pay strictly for bytes scanned ($6.25 per TB) • BigQuery Editions (Standard, Enterprise, Enterprise Plus): Reserve slot capacity (e.g., 100 baseline slots + autoscaling).
How does the BigQuery Storage Write API work and why did it replace the legacy Streaming API?
The Storage Write API uses gRPC streaming and Protocol Buffers to ingest millions of rows per second directly into BigQuery storage.: Exactly-Once Semantics: Supports committed, pending, and default streams • Cost: 50% cheaper than the legacy tabledata.insertAll streaming API.
What is BigQuery BI Engine and how does it achieve sub-second dashboard response times?
BI Engine is an in-memory analysis service. It automatically caches frequently queried data structures in RAM and uses vectorized execution to return dashboard aggregations in milliseconds.
How does BigQuery handle Semi-Structured JSON data using the native JSON type?
The native JSON data type encodes and stores JSON fields using columnar compression. You query attributes with natural syntax (order_data.customer.id) without expensive string parsing.
What are External Tables and Federated Queries in BigQuery?
Allows querying data residing outside BigQuery: Cloud Storage: Parquet, ORC, CSV, JSON files • Cloud SQL / Spanner: Federated queries using EXTERNAL_QUERY().
How do Wildcard Table Queries work in BigQuery and how do you limit scanned partitions?
Wildcard tables query multiple sharded tables using (FROM project.dataset.events). Use the pseudo-column TABLESUFFIX to prune scans (WHERE TABLE_SUFFIX BETWEEN '20260101' AND '20260131').
What is Query Dry Run in BigQuery and how does it prevent expensive accidental queries?
A Dry Run validates query syntax and estimates the exact number of bytes that will be scanned without executing the query or incurring any cost.
Part 2: Query Optimization, Security & Analytics Engineering (11 - 24)
14 QuestionsHow do you diagnose Slot Starvation and Shuffle Bottlenecks in BigQuery Query Plans?
Inspect the Query Execution Graph: Slot Time consumed vs Elapsed Time: High ratio shows successful parallelism • Shuffle Wait Time: Indicates data skew where one worker is processing an unbalanced key.
How do Materialized Views work in BigQuery and what is Smart Query Rewrite?
BigQuery automatically maintains materialized view data as base tables change. Under Smart Query Rewrite, if an analyst queries the base table directly, BigQuery automatically rewrites the query to use the materialized view instead!
How does BigQuery Column-Level Security work using Policy Tags in Dataplex?
Define taxonomy policy tags (e.g., PII_Confidential). Assign tags to columns. Users without the Fine-Grained Reader IAM role receive an access denied error upon querying those columns.
How do you enforce Row-Level Security (RLS) in BigQuery using Row Access Policies?
Attach a Row Access Policy with filter predicates (WHERE region = SESSION_USER()). Users only see rows authorized for their identity without changing query SQL.
What are Authorized Views and Authorized Datasets in BigQuery?
Allows sharing aggregated view results with external users without granting them any access to the underlying sensitive base tables.
How does the Information Schema assist in auditing query performance and costs?
Query INFORMATIONSCHEMA.JOBSBY_PROJECT to analyze total bytes billed, longest running queries, and slot consumption trends.
What is BigLake and how does it unify Data Lakes with BigQuery governance?
BigLake extends BigQuery's storage engine and governance (row-level and column-level security) to open table formats (Apache Iceberg, Delta Lake, Parquet) stored on Google Cloud Storage, AWS S3, and Azure Blob.
What is BigQuery ML (BQML) and how do you train models directly in SQL?
BQML allows data analysts to train machine learning models (Linear Regression, XGBoost, k-means) and generate predictions using pure SQL without exporting data to Python.
How do you integrate Large Language Models (Gemini) inside BigQuery using ML.GENERATE_TEXT?
Use remote models pointing to Vertex AI to run batch LLM prompts directly over millions of customer reviews or support tickets in BigQuery.
How do Broadcast Joins vs Hash Joins work in BigQuery?
Broadcast Join: When joining a massive table with a small dimension table, BigQuery sends the entire small table to all worker slots, avoiding • Hash Join: When joining two large tables, BigQuery partitions both tables by the join key across the shuffle tier.
What is BigQuery Omni and how does it execute cross-cloud analytics?
BigQuery Omni runs Dremel query clusters natively inside AWS and Azure regions, allowing analytics over S3 and Azure Blob without paying cross-cloud data egress fees.
What are Session and Temporary Tables in BigQuery?
Temporary tables are scoped to a multi-statement transaction or script session. They are automatically deleted when the session finishes and incur zero persistent storage costs.
What is Table Snapshot and Table Clone in BigQuery?
Snapshot: Read-only point-in-time reference • Clone: Read-write copy that only charges for delta changes (zero storage cost at creation).
How do you set Maximum Bytes Billed to guard against runaway query costs in BigQuery?
Configure the maximumbytesbilled setting on queries or service accounts. If a query scans more data than the threshold, BigQuery aborts it before execution begins.
Part 3: Enterprise FinOps, Disaster Recovery & Scale (25 - 35)
26 QuestionsHow do you tune queries to prevent "Resources Exceeded During Query Execution" in BigQuery?
Caused by heavy ORDER BY without limits, massive Cartesian joins (CROSS JOIN), or unbounded window functions. Fix by partitioning, filtering before joins, and using APPROXCOUNTDISTINCT().
What are Continuous Queries in BigQuery for real-time streaming pipelines?
SQL queries that run continuously over incoming Pub/Sub or Storage Write API streams and output events to Pub/Sub or Bigtable in real time.
How does Cross-Region Dataset Replication work in BigQuery for High Availability?
Replicates datasets asynchronously to a secondary region (e.g., us-central1 to us-east4). In the event of regional failure, promote the replica to primary.
How do Data Clean Rooms work in BigQuery for privacy-safe data sharing?
Allows two organizations to join and analyze datasets without exposing raw user records, enforcing privacy and differential privacy aggregation.
How do you handle Schema Evolution with BigQuery and the Storage Write API?
BigQuery supports non-destructive schema evolution (adding nullable columns or relaxing REQUIRED to NULLABLE) dynamically without table locks.
What are Object Tables in BigQuery and how do you analyze unstructured data (audio, images)?
Object tables provide a SQL interface over unstructured files stored in Cloud Storage, enabling AI model inference over PDFs, images, and audio.
What is the difference between Physical Storage vs Logical Storage billing in BigQuery?
Logical: Billed on uncompressed data • Physical: Billed on compressed bytes (higher rate per TB, but 3x to 5x less storage due to Capacitor compression).
How do you optimize Dataform pipelines inside BigQuery?
Dataform is Google's built-in SQL workflow orchestrator (similar to dbt) that compiles SQLX into optimized DAG execution pipelines.
How do you prevent Data Skew from degrading BigQuery analytical queries?
Salt join keys or split high-frequency NULL or default keys to prevent single slots from being overwhelmed during hash shuffle.
What are User-Defined Aggregate Functions (UDAFs) and JavaScript UDFs in BigQuery?
Allows implementing custom aggregation algorithms in SQL or writing JavaScript code directly inside queries for complex parsing.
When should you choose Google BigQuery over Snowflake or Amazon Redshift?
Choose BigQuery for a completely hands-off serverless environment, native integration with Google Cloud AI / Vertex AI, and predictable slot reservation pricing.
BigQuery Architecture: Dremel Execution Engine, Colossus Storage, Borg, and Jupiter Network.
BigQuery is a completely serverless multi-tenant data warehouse powered by Google's internal infrastructure: Dremel (Compute): A dynamic, tree-structured multi-stage execution engine that allocates thousands of transient worker slots to evaluate SQL in • Colossus (Storage): Google's global distributed filesystem.
Partitioning vs Clustering in BigQuery: Architectural differences and best practices.
Partitioning: Divides a table into physical date/timestamp, ingestion-time, or integer range segments (up to 4,000 partitions).
BigQuery Slots and Capacity Planning: On-Demand pricing vs BigQuery Editions with Autoscaling.
On-Demand Billing: You pay strictly for the number of bytes scanned by queries (typically $6.25 per TB) • BigQuery Editions (Standard, Enterprise, Enterprise Plus) • Billed for Slot-Hours (compute capacity) • Dynamic Slot Autoscaling: BigQuery scales slots up during heavy query spikes and down to baseline when idle.
BigQuery Storage Write API: Stream ingestion with gRPC, write offsets, and committed vs pending streams.
The modern high-throughput streaming ingestion API replacing legacy tabledata.insertAll: Uses binary gRPC and Protocol Buffers, delivering 10x higher ingestion speeds at 50% lower cost • Committed Stream: Records become immediately queryable in the table as soon as flushed • Pending Stream (Transactional Batch Ingestion).
BigQuery Omni: Multi-cloud analytics querying data directly in AWS S3 and Azure Blob Storage.
Analyzing data spread across multiple clouds without costly egress fees or cross-cloud ETL pipelines: How it works: Google deploys BigQuery's Dremel execution engine inside AWS and Microsoft Azure using Google Anthos • You write standard BigQuery SQL inside the GCP console.
BigQuery BI Engine: In-memory acceleration service and sub-second dashboard performance.
Dashboards (Looker, Tableau, PowerBI) often require sub-second response times, but standard BigQuery queries take 2-4 seconds due to slot allocation overhead: BI Engine: A fully managed in-memory execution service that caches hot table partitions in fast RAM.
BigQuery ML (BQML): Training ML models directly with SQL.
Train and deploy machine learning models directly inside BigQuery without exporting data to Python or Pandas.
Query Plan Execution and Optimization: Diagnosing "Resources exceeded during query execution".
When a query fails with Resources exceeded: Root Cause: The query exceeded the memory allocated to worker slots during an in-memory hash shuffle or sort • Troubleshooting Steps • Inspect Query Plan Execution Details in BigQuery console • Look for stages with high Wait Time (indicates slot starvation) vs high Compute Time.
Materialized Views in BigQuery: Smart tuning, automated query rewrite, and incremental maintenance.
Materialized Views: Pre-computed query tables refreshed incrementally in the background as new rows land in base tables.
Column-Level Security (Policy Tags) and Row-Level Security in BigQuery.
Column-Level Security via Policy Tags (Data Catalog / Dataplex) • Create taxonomy tags: PII -> High_Confidentiality • Attach the tag to the ssn column • Users without the Fine-Grained Reader IAM role receive an Access Denied error if they attempt to query that column.
Time Travel and Table Snapshots: Querying past data and zero-copy snapshots.
Time Travel (up to 7 days): Query the state of any table at a past timestamp.
Search Indexes and Vector Search in BigQuery: `SEARCH()` and `VECTOR_SEARCH`.
BigQuery Search Index: Builds text indexes over STRING and JSON columns for point lookups.
BigQuery Continuous Queries (BigQuery Streams): Real-time streaming SQL.
Traditionally, BigQuery was strictly a batch query engine. Continuous Queries turn BigQuery into a real-time stream processing platform: Define SQL queries that run continuously over incoming Pub/Sub topics or BigQuery table streams.
Cost Control Best Practices in BigQuery: Dry-run, maximum bytes billed, and partition filter enforcement.
Preventing developer queries from running multi-thousand-dollar scans: Dry-Run Validation: Call the API with dryRun=true or inspect the query validator in the console to verify exact byte scan volume before running • Maximum Bytes Billed: Set maximumbytesbilled = 107374182400 (100 GB) • Enforce Partition Filters.
BigQuery Data Governance: Dataplex integration, automated data quality, and lineage.
Managing enterprise compliance across thousands of BigQuery datasets: Dataplex Universal Catalog: Discovers, organizes, and classifies datasets across BigQuery and Cloud Storage lakes • Automated Data Quality (Auto DQ): Runs scheduled declarative quality rules (NOTNULL, REGEXMATCH, VALUE_RANGE) without custom scripts, publishing.