FastPrepObserved-User Percentage by App

Observed-User Percentage by App

Microsoft logoMicrosoft● MediumFULLTIMEPHONE SCREEN

Problem statement

Table app_installs stores each app's total installed-user count. Table app_observations stores user observations by app and date.

For every app in app_installs, return the percentage of installed users who appear at least once in app_observations. Count distinct user IDs across all dates, round the percentage to two decimal places, include apps with no observations as zero, and order rows by app ascending.

Table schema

MySQLPostgreSQLPandas

Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.

app_installs

ColumnTypeNullableDescription
appTextNo—
installed_usersIntegerNo—

app_observations

ColumnTypeNullableDescription
appTextNo—
user_idTextNo—
observed_dateDateNo—

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
appTextNo—
observed_percentageDecimalNo—

Row order: must match exactly. Numeric tolerance: 0.005.

Constraints

  • installed_users is positive for every app.
  • Repeated observations of the same user and app count once.
  • Observation rows for apps absent from app_installs are excluded.
  • The result columns are app and observed_percentage.

More Microsoft problems

See Microsoft hiring insights