PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches

Quick Overview

This question evaluates a candidate's ability to perform cohort-based user attribution and time-series aggregation, specifically assigning users to acquisition cohorts by their first activity and computing total posts and distinct active users by date.

  • Medium
  • TikTok
  • Data Manipulation (SQL/Python)
  • Data Scientist

Analyze Posting Behavior by Cohort and Date

Company: TikTok

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

creator_post +------------+---------+------+ | post_date | user_id | post | +------------+---------+------+ | 2023-01-01 | 111 | 1 | | 2023-01-01 | 222 | 2 | | 2023-01-02 | 111 | 4 | | 2022-01-03 | 333 | 10 | +------------+---------+------+ ##### Scenario Product analytics team wants to understand posting behavior of content creators by acquisition cohort. ##### Question Write SQL to assign each user to a cohort defined by their first post_date (first day they ever posted). For each cohort and each posting_date, return total posts and distinct active users. Order results by cohort_start_date and posting_date. ##### Hints Use window functions or sub-query to get users’ MIN(post_date); join back to original table for aggregation.

Quick Answer: This question evaluates a candidate's ability to perform cohort-based user attribution and time-series aggregation, specifically assigning users to acquisition cohorts by their first activity and computing total posts and distinct active users by date.

Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Find high-value crypto users and top-CTR product - TikTok (easy)
  • Write monthly customer and sales SQL queries - TikTok (easy)
  • Find top-paid employee per department - TikTok (easy)
  • Count buggy vs non-buggy by employer - TikTok (Medium)
  • Select max-discount product per category - TikTok (Medium)