Real questions from top companies in SQL Β· medium
Compare Airflow's @daily vs once trigger scheduling.
Compare OLTP and OLAP systems in the context of financial transactions.
Compare PostgreSQL vs Snowflake. How do they handle duplicate record errors?
Compare the star schema and snowflake schema. Which one would you use for reporting at Swiggy, and why?
Connecting BigQuery with Linux
Explain CTE vs Temp Table. What are the differences and use cases?
Explain Data Modeling SCD Types (Type 1, 2, 3).
Implement a recursive query for hierarchy (employee-manager). Explain the termination guarantees, depth limits, and when a recursive CTE becomes a scalability bottleneck. What alternatives exist for graph-scale hierarchies in Spark or a data lake?
Compare Glue partition discovery with Hive MSCK/ADD PARTITION. Explain the operational and cost implications of crawler-based vs. partition-projection approaches. When does partition projection become necessary, and what are its limitations?
Explain how partitioning and bucketing in Hive/Spark optimize queries. What are the trade-offs in bucket count, partition cardinality, and small-file problem? When does over-partitioning or over-bucketing become counterproductive?
Explain the concept of window functions in SQL and provide an example
Explain the difference between Star and Snowflake schemas. When would you choose one over the other?
Explain the difference between partition count and query performance in Spark.
Find average salary for each manager β Assume a table with manager_id and employee_salary
Find each student's previous year's scores using the LAG function.
Find the third-highest salary for each department.
Finding nth Highest Salary within each department
Given a table with 10 records and another with 4 records, how many records result from a cross join?
Given two dataframes (df1: id, name and df2: id, country, address, city, count), join them, filter for rows where country = 'Singapore', and pivot the output. Sort cities in descending order of population count
How can you delete partitions from a table in Hive using a command?
Type or paste your answer to any of these questions and our AI Coach scores it, highlights gaps, and rewrites it at FAANG quality. Free to try.