Warehouse Inventory Summary
Amazon is preparing an inventory summary for warehouse logistics planning. For each item_type, calculate the number of items (item_count) and their total square footage (total_sqft).
Prepare for SQL interviews by solving problems collected from real interviews at 77 companies, including Amazon, Microsoft, Meta, and others. Each problem identifies its company and covers practical SQL skills, from basic filtering to joins and aggregation. Your query runs in a real database and is automatically checked using hidden data. Problems: 172, free: 44.
Problems in this set: 172, free: 44
Start with a free problemProblems found: 128
Reset filtersAmazon is preparing an inventory summary for warehouse logistics planning. For each item_type, calculate the number of items (item_count) and their total square footage (total_sqft).
The library’s outreach team wants to feature the three most recent book checkouts across the entire library.
Airbnb's recommendation team is looking for pairs of rental properties that share amenities.
Aviasales is running an A/B test of a new search widget to test whether users in group B take more steps within a single session.
CloudReports is building a simple recommendation engine for a streaming service. The idea is to recommend movies to each user that they haven't watched but other users have.
Delimobil, a car-sharing service, collects GPS telemetry from its vehicles approximately once a minute, but poor connectivity sometimes causes gaps in the data.
Google's marketing team is preparing a Super Bowl commercial and analyzing users' search activity.
ivi's marketing team wants to find attribution sequences in which a user first arrived organically and the next view came through a referral link.
Lesta Games analysts want to identify the top 5% of players by total damage dealt across their entire battle history and find each player's highest-damage ship.
MTS Bank is analyzing how clients' card spending grows after their first purchase. For each client, find the date of their first transaction.
Magnit's finance department is analyzing sales growth by quarter.
A pizza chain is offering a fixed price for any pizza with three toppings. From the list of available toppings, generate every unique combination of three different toppings.
Interview problems often ask for counts of users, orders, or actions. Those are different units. When one user generates several events, counting rows can inflate the answer. Before writing SQL, define what one counted item represents and whether repeated records should contribute.
Several users, products, or categories may share the same score. Sorting with LIMIT does not always produce the ranking logic the problem expects. Check whether the requested result is a fixed number of rows or includes all records tied at a particular rank.
Phrases such as during a day, last month, and after a date describe different intervals. A query may work on ordinary records but fail at the boundaries. Check whether start and end values are inclusive and whether the column contains dates or timestamps.
Joining tables can duplicate an order, payment, or user before aggregation. The final numbers may look reasonable even when they are incorrect. Identify the level of detail in each table and verify that the JOIN does not multiply the entity you intend to count or sum.
Yes. Total problems in this collection: 172, free: 44. After signing in, you can solve up to 3 new problems per day on the free plan. Premium problems remain visible in the list but require a subscription to solve.
Reference SQL solutions are not published. You write and submit your own query, which runs in a real database. The trainer automatically compares its output with an expected result using hidden data. Problems include hints and an AI mentor to help with your approach.
Every problem in this collection is associated with a company where it appeared in an interview. The collection covers 77 companies. The name provides context for the question, but solving it still comes down to understanding the tables, the business requirement, and the expected output.
Not entirely. This collection includes different kinds of SQL problems, including selections, joins, aggregations, and more involved data analysis. Rather than memorizing individual query patterns, practice identifying which operations a question requires and checking whether the result is logically correct.
First define what one output row represents: a user, order, product, or event. Then review filters, joins, duplicates, missing values, and date boundaries. For ranking problems, consider ties. These checks can reveal logical mistakes even when the SQL executes without syntax errors.