Customers Who Bought Both Laptop and Monitor in March 2024
Alfa-Bank is preparing a cross-sell offer for a home office setup: a discounted laptop and monitor, plus a free transfer to an investment account.
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 problemAlfa-Bank is preparing a cross-sell offer for a home office setup: a discounted laptop and monitor, plus a free transfer to an investment account.
Every morning, Tinkoff monitors its contact center's SLA and tracks the daily proportion of successfully connected calls. The calls table stores each call's start time, outcome, and duration.
A portfolio analyst wants to identify which bonds appeared in the bank's portfolio most frequently.
MegaFon's finance team wants to smooth out month-to-month revenue changes in one of its billing streams.
A "supercustomer" is someone who has purchased at least one product from every category. Find all such customers and return customer_id and name.
Twitter is analyzing the distribution of user activity in 2022. Group users by their annual tweet count and return that count in a column named tweet_bucket.
The finance department is analyzing repeat account openings. Count the clients who have at least 2 accounts. Return the count in a column named count.
As part of its engineering challenge days, Cian tests engineers' ability to find orphaned records—a problem that also occurs in production when a child record refers to a parent that no longer exists.
Yandex's HR analytics team is preparing a report on the lowest salaries to review employee grades.
Facebook recalculates advertiser statuses every day. For each advertiser in advertiser, determine a new status: EXISTING if daily_pay, which contains today's payments, has a payment from that…
Every evening, Skypro's marketing team reviews daily signups on its landing page. They need to see days without signups as well as days with signups because gaps matter for the analysis.
Magnit's marketing team is preparing a personalized offer for customer user_id = 1 and wants to know how much the customer has spent.
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.