Runtyme
All practice problems

Data Engineering · SQL · Intermediate

SQL interview question: Count the Cups

How many Golden Chai cups disappeared from Hub B overnight? Hub B counted its stock at night and again at dawn.

The problem

  • How many Golden Chai cups disappeared from Hub B overnight?

You'll use: SQL (SQLite) · SELECT & WHERE · JOIN · GROUP BY · TRIM & datetime() · Data cleaning

Solve it free in your browser3–6 min · You write SQL
Show a hint

Look at the raw rows first: SELECT * FROM inventory_counts ORDER BY counted_at;

What this teaches (spoiler)

Before aggregating, deduplicate and filter. Watch for duplicate rows from multiple sources, inconsistent keys, and NULLs that silently drop out of SUM and MAX.

Bug of the Day: a new problem every midnight, free for everyone. Keep a streak with your friends.