Q1
In Google BigQuery, why does Partitioning by date + Clustering by customer_id, status slash both query latency and TB-scanned billing?
Partitioning skips entire unrelated date partitions at metadata pruning time, while Clustering physically co-locates sorted blocks within each partition so BigQuery scans only matching storage blocks instead of whole daily tables.
Q2
Why is SELECT * FROM giant_table LIMIT 10 STILL billed for a full table scan in BigQuery?
BigQuery charges per byte read across referenced columns, and LIMIT only trims output *after* reading full columnar blocks! Select only required columns (or preview free via Storage Read / Console Preview).
Q3
How do BigQuery nested ARRAY<STRUCT<...>> repeated fields outperform normalized 3-table SQL joins at petabyte scale?
Storing order line items inside repeated STRUCT arrays preserves parent-child locality inside Capacitor columnar storage—eliminating expensive network shuffle joins while querying with lightweight UNNEST().
Q4
In Apache Airflow (Cloud Composer), why must you NEVER place database queries or heavy API calls at the top level of a DAG Python file?
The Airflow scheduler parses and executes top-level DAG files every ~30 seconds! External calls at module scope hammer databases constantly and stall task scheduling. Put all execution logic strictly inside Operators / @task functions.
Q5
What causes subtle bugs in Airflow if a task uses datetime.now() instead of Airflow's logical data_interval_start / ds?
datetime.now() breaks idempotency when backfilling historical dates or retrying yesterday's failed run today! Always drive incremental SQL filters from Airflow's logical ds / data_interval_start.
Q6
In Cloud Pub/Sub -> Dataflow streaming pipelines, how do Watermarks and Allowed Lateness handle mobile events arriving 2 hours offline?
Event-time windowing groups records by when they *occurred* rather than processing arrival time; Watermarks estimate window completeness while allowedLateness emits updated panes cleanly when delayed packets trickle in.
Q7
Why does BigQuery's WRITE_TRUNCATE vs MERGE choice matter for deduplicating late/at-least-once streaming batches?
Pub/Sub guarantees at-least-once delivery (possible duplicates). Staging batches and applying idempotent MERGE (or QUALIFY ROW_NUMBER() OVER(PARTITION BY event_id ORDER BY ingested_at DESC) = 1) keeps analytics duplicate-free.
Q8
When should you use BigQuery EXTERNAL tables on Cloud Storage vs native managed BigQuery tables?
External tables avoid ingestion duplication for occasional ad-hoc Parquet scans on GCS, but miss BigQuery's Capacitor storage optimization, clustering pruning, and BI Engine acceleration—load hot tables natively.
Q9
How does XCom fail in Airflow if you pass a 50 MB DataFrame between Python tasks?
Airflow stores XCom payloads inside its small Postgres metadata database. Pass large datasets via Cloud Storage / BigQuery table paths and send ONLY the lightweight URI string in XCom.
Q10
What is the purpose of BigQuery QUALIFY clause—and why do engineers prefer it over nested CTEs for deduplication?
QUALIFY filters window function results directly (QUALIFY ROW_NUMBER() OVER (...) = 1) in a single readable query block without wrapping an extra subquery around WHERE rn = 1.