Interview questions
Predict the result, find the errors, explain the solution. You can read the questions without an account.
23 questions
How many January orders does
BETWEEN '2026-01-01' AND '2026-01-31'find?Predict the resultJuniorWhat do
CAST(created_at AS DATE) = …andcreated_at = CAST(… AS DATE)count?Predict the resultJuniorWill
DATE_TRUNC('month', created_at)run successfully?Predict the resultMiddleHow many days does date subtraction return between January 31 and February 1?
Predict the resultMiddleOn how many days was each user active?
Predict the resultMiddleWhat does
created_at + INTERVAL '1' MONTHreturn for orders placed at the end of a month?Predict the resultMiddleFind the bugs: paid orders in February
Find the errorsJuniorFind the bugs: hires by month
Find the errorsJuniorFind the bugs: DAU for the last three days
Find the errorsMiddleFind the bugs: employees with at least five years of service
Find the errorsMiddleWhich employees match
EXTRACT(DAY FROM hired_at) = 1?Predict the resultJuniorHow many events fall within a five-minute window?
Predict the resultJuniorWhich orders match the midnight-hour filter?
Predict the resultJuniorWhich users were active on both sides of the month boundary?
Predict the resultMiddleHow many earlier paid orders does a temporal
SELF JOINfind?Predict the resultMiddleWhat does grouping events by hour return?
Predict the resultMiddleWhich orders were placed after each user's last event?
Predict the resultMiddleFind the bugs: time of each customer's latest payment
Find the errorsJuniorFind the bugs: customer events before an order
Find the errorsMiddleFind the bugs: customers whose first order was in March
Find the errorsMiddle