Practice Interview Questions
| Question | Status |
|---|---|
Given a table containing user IDs and the dates they visited the platform, the task is to identify the top 3 users with the longest continuous streak of visiting the platform as of August 20, 2023. The output should include the user ID and the length of their streak. In case of a tie, all users with the top 3 longest streaks should be displayed.
user_streaks table:
| Column Name | Description |
|---|---|
| user_id | Identifier of the user |
| date_visited | Time of the user's visit |
| user_id | streak_length |
|---|---|
| 1432 |
| 28 |
| 1312 | 23 |
| 1431 | 22 |
Given a table containing user IDs and the dates they visited the platform, the task is to identify the top 3 users with the longest continuous streak of visiting the platform as of August 20, 2023. The output should include the user ID and the length of their streak. In case of a tie, all users with the top 3 longest streaks should be displayed.
user_streaks table:
| Column Name | Description |
|---|---|
| user_id | Identifier of the user |
| date_visited | Time of the user's visit |
| user_id | streak_length |
|---|---|
| 1432 | 28 |
| 1312 | 23 |
| 1431 | 22 |