SQL questions from Swiggy data engineering interviews.
These sql questions are sourced from Swiggy data engineering interviews. Each includes an expert-level answer. This set leans toward the medium-difficulty band most real interviews actually live in (15 of 21). Recurring themes are join, sql, and partition — these patterns appear most often in real interviews and reward the deepest preparation. Many of these questions also surface at Presidio and Daniel Wellington, so the preparation transfers across companies. Average answer is around 1 minute of reading — plan roughly 1 hour to work through the full set thoughtfully.
This collection contains 21 curated questions: 5 easy, 15 medium, and 1 hard. There's a strong foundation of fundamentals-focused questions — ideal for building confidence before tackling advanced topics.
The most frequently tested areas in this set are join (9), sql (8), partition (7), window (3), etl (1), and bigquery (1). Focusing on these topics will give you the highest return on your preparation time.
Start with the easy questions to warm up and solidify fundamentals. Medium-difficulty questions form the bulk of real interviews — spend the most time here and practice explaining your reasoning out loud. Hard questions often appear in senior and staff-level rounds; attempt them after you're comfortable with the basics. For each question, try answering before revealing the solution. Use our AI Mock Interview to simulate real interview conditions and get instant feedback on your responses.
Describe a scenario where partitioning and bucketing would improve query performance.
Difference between ROW_NUMBER(), RANK(), and DENSE_RANK() with examples.
Difference between where and having clause with examples.
Explain the difference between UNION and UNION ALL.
Implement a query to find the top 5 customers by total sales amount.
What are primary keys and foreign keys? Why are they important?
What is a self-join, and when would you use it?
What is normalization and denormalization? When would you use each?
What is the difference between a clustered and non-clustered index?
What is the difference between a view and a materialized view?
What is the difference between DELETE and TRUNCATE?
Write an SQL query to find duplicate emails in a users table.
Compare the star schema and snowflake schema. Which one would you use for reporting at Swiggy, and why?
Describe a situation where you prioritized business needs over technical elegance. How did you manage trade-offs?
How do you handle NULL values in a SQL query to avoid incorrect results?
How do you secure sensitive customer data in a data warehouse?
How would you design a data model for an e-commerce platform?
Optimize a slow SQL query for a large orders table containing billions of rows.
What are Slowly Changing Dimensions (SCD), and how would you implement them for tracking customer data changes?
Write a SQL query to find the top 5 most ordered dishes in the last 30 days.
Write a query to identify duplicate customer entries based on email and phone number.
Get full access to 1,800+ expert answers, AI mock interviews, and personalized progress tracking.