Google-style Company ChallengeBeginnerVerified answerSQLite live

Mobile Users

Which users signed up using a mobile device?

  • Filtering
  • Sorting

Challenge brief

Understand the request

Device Strategy is evaluating mobile-first product investments and needs a list of all users who registered via a mobile device.

Return user_id, country, device_type, signup_date in the declared deterministic order.

Return

  • user_id
  • country
  • device_type
  • signup_date

Constraints

  • Return only users whose device type is 'mobile'
  • Order by user ID

Data you will use

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

users

  • user_idINTEGER
  • countryVARCHAR(50)
  • device_typeVARCHAR(20)
  • signup_dateDATE

Hints, when you need them

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

Hint 1

The device attribute is stored with each user.

Hint 2

Apply the device condition before projection.

Hint 3

Return the requested user attributes in identifier order.

Verified SQL answer

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

Reveal solution and explanation
SELECT user_id, country, device_type, signup_date FROM users WHERE device_type = 'mobile' ORDER BY user_id

Why this works

12 of 23 users signed up on mobile. The other 11 used desktop (7) or tablet (4). SELECT * returns all four columns for the filtered rows.

Success check

Returns the complete deterministic result for mobile users

Expected result

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

user_idcountrydevice_typesignup_date
1USAmobile2023-01-15
3UKmobile2023-03-10
4Indiamobile2023-04-05
7Germanymobile2023-07-22
8Indiamobile2023-08-30
10Canadamobile2023-10-25
11USAmobile2023-11-05
13Japanmobile2023-12-01
15Brazilmobile2024-01-05
17UKmobile2024-01-15

Previewing 10 of 13 expected rows. Run the query in the editor to inspect the full result.

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.