Interview Query

Cross-Platform Optimization

Start Timer

0:00:00

Upvote
3
Downvote
Save question
Mark as completed
View comments (4)
Next question

You have been tasked with optimizing cross-platform user experience. To do this, you will analyze user interaction data on both web and mobile. The goal is to understand user behavior, preferences, and engagement patterns.

The database includes two tables; one for all mobile actions from users and one for all web actions from users.

Consider the following questions:

  • How many unique users visited pages on mobile only?
  • What percentage of web visitors visited pages on web only?
  • Write a query that returns the percentage of users who visited only mobile, only web, and both. The percentage of users who are only in the mobile table, only in the web table, and in both tables should sum to 1.

Example:

Input:

mobile_tbl table:

Column Type Description
user_id DECIMAL User id who visited page on mobile.
page STRING Page visited by user on mobile.

Input:

web_tbl table:

Column Type Description
user_id DECIMAL User id who visited page on web.
page STRING Page visited by user on web.
.
.
.
.
.


Comments

Loading comments