Q4
Subqueries
31 stations · 4.7hScalar, IN / NOT IN, EXISTS and correlated subqueries; Nth highest and 'bought all' problems. 31 interview problems explained by Everyday Data Science (4.7h of video), grouped into 4 patterns such as Nth highest, Matches every / all (relational division), NOT IN / NOT EXISTS.
Start this line →- Nth highest3
- Matches every / all (relational division)1
- NOT IN / NOT EXISTS5
- Correlated subquery2
- Other20
Nth highest
0 of 3 passed- Second Highest SalaryLC 176 · 9:44MediumGoogle · Amazon · +16 more companiesLeetCode ↗ (opens in a new tab)
- Nth Highest SalaryLC 177 · 6:35MediumGoogle · Amazon · +9 more companiesLeetCode ↗ (opens in a new tab)
- Department Highest SalaryLC 184 · 7:21MediumGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
Matches every / all (relational division)
0 of 1 passed- Customers Who Bought All ProductsLC 1045 · 7:01MediumGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
NOT IN / NOT EXISTS
0 of 5 passed- Customers Who Never OrderLC 183 · 17:35EasyGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
- Students With Invalid DepartmentsLC 1350 · 5:27 · LeetCode PremiumEasyAmazonLeetCode ↗ (opens in a new tab)
- Employees Whose Manager Left the CompanyLC 1978 · 6:25EasyGoogle · Microsoft · +1 more companiesLeetCode ↗ (opens in a new tab)
Correlated subquery
0 of 2 passed- Product Price at a Given DateLC 1164 · 9:50MediumGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
- Find Cutoff Score for Each SchoolLC 1988 · 13:05 · LeetCode PremiumMediumLeetCode ↗ (opens in a new tab)
Other
0 of 20 passed- Biggest Single NumberLC 619 · 9:18EasyGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
- Drop Type 1 Orders for Customers With Type 0 OrdersLC 2084 · 15:21 · LeetCode PremiumMediumLeetCode ↗ (opens in a new tab)
- The Airport With the Most TrafficLC 2112 · 10:28 · LeetCode PremiumMediumLeetCode ↗ (opens in a new tab)
- Immediate Food Delivery IILC 1174 · 10:51MediumGoogle · Amazon · +5 more companiesLeetCode ↗ (opens in a new tab)
- Game Play Analysis IILC 512 · 5:31 · LeetCode PremiumEasyAmazon · GSN GamesLeetCode ↗ (opens in a new tab)
- Investments in 2016LC 585 · 17:36MediumGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
- Managers with at Least 5 Direct ReportsLC 570 · 5:31MediumGoogle · Amazon · +5 more companiesLeetCode ↗ (opens in a new tab)
- Friend Requests II: Who Has the Most FriendsLC 602 · 7:09MediumGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
- Product Sales Analysis IIILC 1070 · 5:59MediumGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
- Game Play Analysis IVLC 550 · 8:35MediumGoogle · Amazon · +5 more companiesLeetCode ↗ (opens in a new tab)
All 31 stations in order
- 1.Customers Who Never Order (LeetCode 183)
- 2.Biggest Single Number (LeetCode 619)
- 3.Students With Invalid Departments (LeetCode 1350)
- 4.Employees With Missing Information (LeetCode 1965)
- 5.Drop Type 1 Orders for Customers With Type 0 Orders (LeetCode 2084)
- 6.Sales Analysis I (LeetCode 1082)
- 7.Sales Person (LeetCode 607)
- 8.Activity Participants (LeetCode 1355)
- 9.The Airport With the Most Traffic (LeetCode 2112)
- 10.Product Price at a Given Date (LeetCode 1164)
- 11.Customers Who Bought All Products (LeetCode 1045)
- 12.Immediate Food Delivery II (LeetCode 1174)
- 13.Active Businesses (LeetCode 1126)
- 14.Second Highest Salary (LeetCode 176)
- 15.Find Cutoff Score for Each School (LeetCode 1988)
- 16.Movie Rating (LeetCode 1341)
- 17.Game Play Analysis II (LeetCode 512)
- 18.Sellers With No Sales (LeetCode 1607)
- 19.Investments in 2016 (LeetCode 585)
- 20.Employees Whose Manager Left the Company (LeetCode 1978)
- 21.Project Employees II (LeetCode 1076)
- 22.Nth Highest Salary (LeetCode 177)
- 23.Department Highest Salary (LeetCode 184)
- 24.Managers with at Least 5 Direct Reports (LeetCode 570)
- 25.Winning Candidate (LeetCode 574)
- 26.Sales Analysis II (LeetCode 1083)
- 27.Page Recommendations (LeetCode 1264)
- 28.Friend Requests II: Who Has the Most Friends (LeetCode 602)
- 29.Product Sales Analysis III (LeetCode 1070)
- 30.Game Play Analysis IV (LeetCode 550)
- 31.Popularity Percentage (LeetCode 2720)