Works Checked Out More Than 5 Times
A library wants to identify popular works. Find works that have been checked out more than 5 times. Return title and checkout_count. Sort the result by checkout count in descending order.
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: 117
Reset filtersA library wants to identify popular works. Find works that have been checked out more than 5 times. Return title and checkout_count. Sort the result by checkout count in descending order.
A ride-hailing service is ranking its busiest drivers. For each driver, count all rides in the service's history, including canceled rides. Find the top 5 drivers. Return name and ride_count.
Avito's product analytics team tracks revenue stability among major sellers.
The sales team is looking for accounts belonging to companies whose names contain the substring SBER. For all such companies, return the account_id and account_type of their accounts.
A streaming platform is preparing a top-5 list of shows by viewership. For each series, sum viewer_count across all view records. Find the 5 series with the highest total viewer counts.
The support team is evaluating how quickly bugs are fixed. For each severity, calculate the average number of days between reported_date and fixed_date.
The logistics team is preparing a delivery summary. For each order, return its ID, the customer's name, the order date, and the order status. Sort the result by order date in descending order.
Spotify wants to find the artists whose songs have appeared most often in the global chart's Top-10. Find the 5 artists with the most such appearances. Return artist_name and chart_appearances.
Uber is preparing a report on user transactions. For each user with at least three transactions, find their third transaction when ordered by date from earliest to latest.
Vizor buys mobile traffic through ad networks and compares performance by country.
The CRM team wants to identify clients with the most registered devices. Find the 5 clients with the highest device counts and return name and device_count.
Analysts are preparing a summary of property counts across cities. For each city, count the number of properties. Return city and property_count. Sort the result by property count in descending order.
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.