InterviewStack.io LogoInterviewStack.io

Distributed SQL and Query Scaling Questions

Principles and practices for running and optimizing SQL queries in distributed query engines and cloud data warehouses. Candidates should understand how distributed execution affects query performance including partitioning strategies, shuffle operations, data skew, partition pruning, and cost based optimization in engines such as Spark SQL, Presto, and BigQuery. This topic includes designing queries to minimize data movement, choosing appropriate partition keys, leveraging cluster resources efficiently, and interpreting execution plans and job stages to diagnose bottlenecks in large scale queries.

MediumTechnical
61 practiced
Explain predicate pushdown and projection pushdown in distributed SQL engines. Give an example where using SELECT * causes unnecessary data movement and how to rewrite the query to ensure filters and projections are applied as early as possible.
MediumTechnical
78 practiced
A business dashboard queries multiple large tables and takes 2 minutes to load. As a data analyst, outline a prioritized plan to reduce dashboard latency to under 15 seconds. Consider query design, materialized views, pre-aggregations, cache policies, and BI tool behavior in your plan.
EasyTechnical
73 practiced
Describe the difference between broadcast (map-side) joins and shuffle (repartition) joins in engines like Spark SQL and Presto. For a data analyst joining a 200-row lookup table to a 1TB fact table, which join would you expect and why? Mention memory and network considerations and any safety checks you would perform before encouraging broadcast.
EasyTechnical
116 practiced
You have a sales table partitioned by sale_date (DATE) with schema sales(order_id INT, sale_date DATE, customer_id INT, amount NUMERIC). Show two example SQL predicates that will allow partition pruning and two that will prevent pruning. Explain why the latter fail to prune and how to rewrite them for better performance in a cloud warehouse.
MediumTechnical
79 practiced
Design partitioning keys for an e-commerce events table used for nightly aggregation and ad-hoc user lookups. Consider common query patterns (time-based aggregations vs point lookups), partition count limits, small partition problems, and how to balance scan efficiency with write throughput and compaction needs.

Unlock Full Question Bank

Get access to hundreds of Distributed SQL and Query Scaling interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.