InterviewStack.io LogoInterviewStack.io

Analytical Query Performance and Optimization Questions

Diagnosing and tuning analytical queries on distributed and warehouse engines. Covers reading and reasoning about query plans, join strategy and ordering including broadcast versus shuffle, statistics and cardinality estimation, materialized views and result caching, skew and spill diagnosis, workload management and concurrency, and the cost side of query performance on engines billed by bytes scanned or compute time. The altitude is the deep, engine-specific operational layer: what a real plan on a real warehouse engine is telling you and what to change. Generic single-engine query-tuning fundamentals, the physical layout of the data being scanned, and the choice of which managed platform to run on are covered separately.

MediumTechnical
45 practiced

Compare ETL and ELT specifically for a cloud data warehouse: where does transformation happen in each, and how does that choice affect downstream query performance and compute cost (not just pipeline architecture)? Why have modern cloud warehouses pushed many teams toward ELT?

MediumTechnical
88 practiced

Design a cache-invalidation strategy for precomputed dashboard results that normally refresh hourly but must also support an ad-hoc user-triggered Refresh. How do you balance cache TTL, manual invalidation requests, and background refresh jobs, and how do you avoid a thundering herd of recomputation exactly at the hour boundary?

MediumTechnical
53 practiced

Describe a step-by-step approach to profile and diagnose a slow query in a warehouse engine of your choice (Snowflake's Query Profile, BigQuery job statistics, or Redshift's STL/SVL system tables), or contrast it with reading a Spark SQL logical versus physical plan. Which metrics (bytes/slots scanned, shuffle volume, CPU) are most informative in each, and how would you use them to pinpoint the bottleneck?

MediumTechnical
47 practiced

A dashboard that used to load in about 2 seconds now takes about 20 seconds. Walk through a systematic debugging plan across the layers that could be responsible: frontend rendering, the BI tool's generated query, the query engine, the caching layer, and upstream data changes. What telemetry, logs, or quick experiments would you use to isolate the root cause, and what would you do to reduce user impact while you investigate?

MediumTechnical
50 practiced

How would you implement guardrails to prevent a single runaway query from blowing your BigQuery or Presto-based lakehouse budget? Discuss dry-run cost estimation, maximum-bytes-scanned quotas, query linting, and automatic abort policies, and how you would make those guardrails feel helpful rather than punitive to analysts.

Unlock Full Question Bank

Get access to all 24 Analytical Query Performance and Optimization interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.