Microsoft-style Company ChallengeEasyVerified answerSQLite live

Recent Users

Which users signed up in March 2024?

  • Filtering
  • Sorting

Challenge brief

Understand the request

Onboarding Team is analysing the March 2024 new user cohort for a welcome-sequence review.

List user_ids who signed up on or after 2024-03-01.

Return

  • user_id

Constraints

  • Include signups on or after 2024-03-01 and before 2024-04-01
  • Order by user ID

Data you will use

Review the relevant tables before deciding how to join, filter, or aggregate them.

users

  • user_idINTEGER
  • countryTEXT
  • signup_dateDATE

Hints, when you need them

Open one clue at a time so you still do the reasoning.

Hint 1

All signup data is in users. Filter signup_date >= '2024-03-01' to get March users. No JOIN needed.

Hint 2

SELECT user_id FROM users WHERE signup_date >= '2024-03-01'.

Hint 3

Build question 9 from the required result grain: choose the driving table, add only the joins and filters needed for that grain, then apply aggregation and deterministic ordering.

Verified SQL answer

Attempt the problem first, then compare structure and reasoning—not just syntax.

Reveal solution and explanation
SELECT user_id FROM users WHERE signup_date >= '2024-03-01' AND signup_date < '2024-04-01' ORDER BY user_id;

Why this works

Use a half-open March date range so future signups do not leak into the cohort. The exclusive April boundary remains correct for date or timestamp values.

Success check

8 users — user_ids 5 through 12, all signed up in March 2024

Expected result

Use this output to verify values, aliases, ordering, and row count.

user_id
5
6
7
8
9
10
11
12

Learn the concepts behind this answer

Strengthen your understanding with these targeted learning topics:

Continue practicing

SQL Interview Practice

Return to the complete interview preparation experience.