Fastest Bug Fix by Severity
The support team wants to identify the fastest bug fixes. For each severity, find the minimum number of days between reported_date and fixed_date.
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 filtersThe support team wants to identify the fastest bug fixes. For each severity, find the minimum number of days between reported_date and fixed_date.
Ozon's HR analytics team is looking for compensation anomalies—cases where an active employee earns more than their direct manager.
Spotify wants to find the artists whose songs appeared in the global chart's top 10 on the most distinct days.
An analyst wants to examine each user's third activity by date.
Vizor is analyzing unit economics before launching a mobile game. Find the campaign with the lowest cost per install and identify its highest-paying users.
The CRM team is preparing an upsell campaign for clients who recently bought devices.
The valuation team wants to know the average property price in Moscow. Calculate the average price of properties in that city, round it to 2 decimal places, and return it in the avg_price column.
A video streaming service wants to identify its most consistent viewers in January. Find users who watched videos on every one of the 31 days in January 2022. Return user_id.
MTS is analyzing which dates have a high number of iPhone owners recorded in its device database.
The logistics team is preparing a report on active warehouses. For each city, count the warehouses where is_active = true. Return city and warehouse_count.
At Uchi.ru, a product analyst is dividing students' event streams into sessions. A new session starts when more than 30 minutes have passed since the previous event for the same student.
Facebook is measuring user retention to determine how many users who were active in June 2022 remained active in July 2022. Count these users and return the result in a column named retained_users.
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.