InterviewStack.io LogoInterviewStack.io

Database Design and Query Optimization Questions

Principles of database schema design and performance optimization including relational and non relational trade offs, normalization and denormalization, indexing strategies and index types, clustered and non clustered indexes, query execution plans, common table expressions for readable complex queries, detecting missing or redundant indexes, sharding and partitioning strategies, and consistency and availability trade offs. Candidates should demonstrate knowledge of optimizing reads and writes, diagnosing slow queries, and selecting the appropriate database model for scale and consistency requirements.

MediumTechnical
74 practiced
Row-level security (RLS) and column-level encryption protect data but can impact performance. As a BI Analyst, explain how RLS policies and encryption-by-column affect query plans and indexes, and propose design strategies to minimize performance impact while maintaining required security.
EasyTechnical
51 practiced
Explain the differences between OLTP and OLAP systems and why a BI Analyst would choose one over the other for reporting. In your answer describe: typical data models (normalized vs dimensional), storage characteristics (row vs columnar), indexing approaches, typical query patterns, example workloads (e.g., high-concurrency transactions vs large aggregations), and performance considerations for dashboards that aggregate months of sales data.
HardSystem Design
43 practiced
Design a monitoring and alerting system for query performance and ETL jobs supporting BI dashboards. Specify what metrics to collect (latency percentiles, error rates, backlogs), alert thresholds, dashboards to show, and automated remediation or runbook steps for common failures like slow queries or job failures.
MediumTechnical
43 practiced
Discuss the trade-offs between using CTEs and temporary tables for complex multi-step ETL/SQL logic in a BI pipeline. Include performance considerations, materialization behavior, statistics availability, and maintainability. Mention DB-specific behaviors you know (e.g., older Postgres versions materialize CTEs).
MediumTechnical
50 practiced
You have a query that groups by country and product and orders by total_sales descending with LIMIT 20. Propose index strategies or pre-aggregation to make this query fast at scale, and explain how an index can or cannot be used for GROUP BY and ORDER BY in this scenario.

Unlock Full Question Bank

Get access to hundreds of Database Design and Query Optimization interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.