Write SQL and Python, run instantly in your browser, and track your progress.
You are a Community Engagement Analyst at Meta. The team needs to analyze recent user posting behavior to optimize content recommendations and identify active community contributors. For each user, your task is to identify their two most recent published posts to power engagement algorithms, content moderation workflows, and creator monetization programs. This data drives Facebook's News Feed ranking and Instagram's Explore page recommendations.
| Column Name | Type |
|---|---|
| post_id | INTEGER |
| user_id | INTEGER |
| content_text | TEXT |
You are a Community Engagement Analyst at Meta. The team needs to analyze recent user posting behavior to optimize content recommendations and identify active community contributors. For each user, your task is to identify their two most recent published posts to power engagement algorithms, content moderation workflows, and creator monetization programs. This data drives Facebook's News Feed ranking and Instagram's Explore page recommendations.
| Column Name | Type |
|---|---|
| post_id | INTEGER |
| user_id | INTEGER |
| content_text | TEXT |
| content_type |
| content_type |
| TEXT |
| TEXT |
| link_url | TEXT |
| link_url | TEXT |
| visibility | TEXT |
| visibility | TEXT |
| created_at | TEXT |
| created_at | TEXT |
| status | TEXT |
| status | TEXT |
| post_id | user_id | content_text | content_type | link_url | visibility | created_at | status |
|---|---|---|---|---|---|---|---|
| 1 | 1 | Answering your questions about entrepreneurship | video | followers | 2025-05-28 17:39:24 |
| post_id | user_id | content_text | content_type | link_url | visibility | created_at | status |
|---|---|---|---|---|---|---|---|
| 1 | 1 | Answering your questions about entrepreneurship | video | followers | 2025-05-28 17:39:24 |
| user_id | post_id | created_at | post_rank |
|---|---|---|---|
| 1 | 3 | 2025-06-02 01:35:31 | 1 |
| 1 | 1 | 2025-05-28 17:39:24 | 2 |
| 2 | 4 | 2025-07-19 11:27:33 | 1 |
| 2 | 6 | 2025-03-28 11:40:27 | 2 |
| user_id | post_id | created_at | post_rank |
|---|---|---|---|
| 1 | 3 | 2025-06-02 01:35:31 | 1 |
| 1 | 1 | 2025-05-28 17:39:24 | 2 |
| 2 | 4 | 2025-07-19 11:27:33 | 1 |
| 2 | 6 | 2025-03-28 11:40:27 | 2 |
Showing first 5 of 99 rows. Top 2 posts per user by created time.
Showing first 5 of 99 rows. Top 2 posts per user by created time.
Output Requirements:
Business Logic:
Data Filters:
Output Requirements:
Business Logic:
Data Filters:
| published |
| published |
| 2 | 1 | For everyone asking about technology, here's a helpful resource | link | https://example.com/41544 | public | 2025-04-20 09:23:49 | published |
| 2 | 1 | For everyone asking about technology, here's a helpful resource | link | https://example.com/41544 | public | 2025-04-20 09:23:49 | published |
| 3 | 1 | Sunset vibes from Austin | image | followers | 2025-06-02 01:35:31 | published |
| 3 | 1 | Sunset vibes from Austin | image | followers | 2025-06-02 01:35:31 | published |
| 4 | 2 | What's your take on web development? | poll | followers | 2025-07-19 11:27:33 | published |
| 4 | 2 | What's your take on web development? | poll | followers | 2025-07-19 11:27:33 | published |
| 5 | 2 | Morning coffee and good vibes | image | followers | 2025-08-04 14:31:30 | hidden |
| 5 | 2 | Morning coffee and good vibes | image | followers | 2025-08-04 14:31:30 | hidden |
| 3 | 14 | 2025-08-17 02:52:19 | 1 |
| 3 | 14 | 2025-08-17 02:52:19 | 1 |
Sorting Requirements:
Sorting Requirements: