DataEngPrep.tech
QuestionsPracticeAI CoachDashboardPacksBlog
ProLogin

Interview Questions

Real questions from top companies in SQL Β· medium

700+ Easy450+ Medium650+ Hard
All CategoriesBehavioralSpark/Big DataSQLPython/CodingSystem Design/ArchitectureCloud/ToolsGeneral/Othereasymediumhard
101

Find average salary for each manager – Assume a table with manager_id and employee_salary

SQLmedium0.2 min read
Pubmatic
β†’
102

Find each student's previous year's scores using the LAG function.

SQLmediumpartition0.2 min read
Deolite
β†’
103

Find employees who earn the third-highest salary.

SQLmedium0.2 min read
Incedo
β†’
104

Find the 2nd highest salary for each department using the DENSE_RANK() function.

SQLmediumpartition0.3 min read
Bitwise
β†’
105

Find the error in the provided SQL query.

SQLmediumjoinsql0.3 min read
Grover
β†’
106

Find the second-highest salary in the employees table using three different methods.

SQLmediumwindow0.3 min read
Tredence
β†’
107

Find the third-highest salary for each department.

SQLmediumpartition0.2 min read
Freight Tiger
β†’
108

Finding nth Highest Salary within each department

SQLmediumpartition0.2 min read
Walmart
β†’
109

Given a complex nested query, how would you refactor it for better readability and efficiency?

SQLmediumjoinwindow0.3 min read
Goldman Sachs
β†’
110

Given a table of sales data, use window functions to calculate a running total.

SQLmediumpartitionwindow0.2 min read
American Express
β†’
111

Given a table with 10 records and another with 4 records, how many records result from a cross join?

SQLmediumjoin0.2 min read
Aarete
β†’
112

Given a table with sales data, write a query to find consecutive days with decreasing revenue.

SQLmediumjoin0.3 min read
Uber
β†’
113

Given an unoptimized query execution plan, how would you diagnose and improve performance?

SQLmediumjoinpartition0.3 min read
BCG
β†’
114

Given the data below, explain the results of different types of joins: Inner Join, Left Join, Right Join. Will a schema be created?

SQLmediumjoin0.2 min read
Coforge
β†’
115

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

SQLmediumjoin0.2 min read
JP Morgan
β†’
116

Given two tables, calculate the row count for different types of joins (inner, left, right, and full outer)

SQLmediumjoinsql0.3 min read
Morgan Stanley
β†’
117

Handle nulls, duplicates, and inconsistent timestamp formats in data.

SQLmediumpartition0.3 min read
Apple
β†’
118

Hierarchical Employee-Manager Query - navigate hierarchy with head of company as employee_id = 1

SQLmediumjoin0.3 min read
JP Morgan
β†’
119

How can you delete partitions from a table in Hive using a command?

SQLmediumpartition0.2 min read
Dunnhumby
β†’
120

How do partitioning strategies differ between source and sink?

SQLmediumpartition0.3 min read
Virtusa
β†’

Reading isn't practice. Get AI feedback on your answers.

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.

Try AI Answer Coach β€” FreeStart a Mock Interview
Previous1...45678...14Next
Categories
All QuestionsSQLSpark / Big DataPython / CodingSystem DesignCloud / ToolsBehavioral
By Company
AmazonGoogleDatabricksSnowflakeMicrosoftNetflixUberTCS
Interview Guides
All GuidesTop SQL QuestionsTop Spark QuestionsTop Python QuestionsTop System DesignSQL Window FunctionsETL QuestionsData Modeling
Products
AI Interview CoachAnswer AnalyzerSQL PlaygroundResume AnalyzerInterview PacksPricing
Company
About UsContact UsAI DisclosureDisclaimerTerms of ServicePrivacy Policy
Β© 2026 DataEngPrep.tech. All rights reserved.
AboutBlogContactDisclaimer