Interview Query

7 Day Streak

Start Timer

0:00:00

Upvote
35
Downvote
Save question
Mark as completed
View comments (106)
Next question

Given a table with event logs, find the percentage of users that had at least one seven-day streak of visiting the same URL.

Note: Round the results to 2 decimal places. For example, if the result is 35.67% return 0.35.

Example:

Input:

events table

Column Type
user_id INTEGER
created_at DATETIME
url VARCHAR

Output

Column Type
percent_of_users FLOAT
.
.
.
.
.


Comments

Loading comments...