TikTok Data Manipulation (SQL/Python) Interview Questions

TikTok Data Manipulation (SQL/Python) interview questions focus on real-world data problems at extreme scale: expect tasks that test your ability to transform messy event logs, compute cohort and funnel metrics, and optimize queries or scripts for performance. Interviews emphasize SQL fluency—joins, window functions, aggregates, CTEs, NULL handling and performance tradeoffs—alongside Python data-manipulation using pandas or lightweight algorithms. Interviewers evaluate correctness, edge-case handling, runtime and space complexity, clarity of thought, and the ability to explain tradeoffs and assumptions. Product context and experiment-signal thinking often appear alongside purely technical prompts. For interview preparation, plan for a short recruiter screen followed by several technical rounds that include timed SQL problems (often on a coding platform), Python scripting challenges, and for some roles, questions about big-data tooling or data pipelines. Practice writing runnable SQL from sample schemas, reproducing logic in pandas, and explaining your approach out loud. Time yourself on medium-to-hard problems, revisit fundamentals like window functions and grouping vs HAVING, and prepare concise examples from your experience that show impact and ownership. Mock interviews and clean, commented code will raise your confidence on test day.

33 Questions 1 Company02.04.2026
Showing 20 results
Role
TikTok logo
TikTok
Medium
Data Scientist

Calculate valid daily usage with gap constraints

Write Standard SQL to compute, for a given date (use 2025-09-01), each user's total valid usage minutes. Schema and rules: Schema (timestamps are UTC)...

Data Manipulation (SQL/Python)
12
0
94 people solved
Oct 13, 2025
TikTok logo
TikTok
Easy
Data Scientist

Find top-paid employee per department

Tables Assume the company stores employee compensation by department assignment. employee_dept_salary - employee_id INT - employee_name VARCHAR - depa...

Data Manipulation (SQL/Python)
5
0
88 people solved
Nov 8, 2025
TikTok logo
TikTok
Medium
Data Scientist

Analyze shopping funnel with joins and windows

Write SQL (PostgreSQL) to analyze a 4-step shopping funnel: view_product → add_to_cart → checkout_start → purchase. Use the schema and sample data bel...

Data Manipulation (SQL/Python)
14
0
115 people solved
Oct 13, 2025
TikTok logo
TikTok
Easy
Data Scientist

Write SQL for TikTok Live creator metrics

You are analyzing TikTok Live sessions and their engagement. Tables live_room Each row is a Live session (“room”) launched by a creator. | column | ty...

Data Manipulation (SQL/Python)
17
0
137 people solved
Oct 9, 2025
TikTok logo
TikTok
Easy
Data Scientist

Find high-value crypto users and top-CTR product

You are given three tables (timezone: UTC). Assume create_date, transaction_time, and event_time are timestamps. Tables users - user_id BIGINT PRIMARY...

Data Manipulation (SQL/Python)
4
1
75 people solved
Feb 4, 2026
TikTok logo
TikTok
Medium
Software Engineer

Discuss Python mutability, copying, and GIL

In Python, explain the differences between mutable and immutable objects and illustrate how they affect function arguments and container behavior. Des...

Data Manipulation (SQL/Python)
5
0
51 people solved
Sep 6, 2025
TikTok logo
TikTok
Medium
Data Scientist

Calculate User Registration Date and 7-Day Retention Rate

user_posts +---------+--------------+-----------+ | user_id | posting_date | num_posts | +---------+--------------+-----------+ | 1 | 2023-01-01...

Data Manipulation (SQL/Python)
81
0
7 people solved
Jul 12, 2025
TikTok logo
TikTok
Medium
Data Scientist

Count buggy vs non-buggy by employer

Count buggy vs non-buggy submissions for each employer_id, including employers with zero submissions. Return employer_id, buggy_count, non_buggy_count...

Data Manipulation (SQL/Python)
1
0
10 people solved
Oct 13, 2025
TikTok logo
TikTok
Medium
Data Scientist

Select max-discount product per category

You have a catalog of products. For each category, return exactly one product: the one with the largest absolute discount; if multiple products in the...

Data Manipulation (SQL/Python)
1
0
9 people solved
Oct 13, 2025
TikTok logo
TikTok
Medium
Data Scientist

Write SQL for last-7-day metrics without windows

Assume today is 2025-09-01. Use ANSI SQL only and do not use window functions. You may use subqueries, GROUP BY, HAVING, and JOINs. Schema and small s...

Data Manipulation (SQL/Python)
0
0
10 people solved
Oct 13, 2025
TikTok logo
TikTok
Medium
Software Engineer

Debug a Hive query

You are given a prewritten Hive SQL query that produces incorrect results. Describe how you would debug it: identify logical errors (e.g., join condit...

Data Manipulation (SQL/Python)
0
0
3 people solved
Sep 6, 2025
TikTok logo
TikTok
Medium
Data Scientist

Calculate Conversion Rate from Ad Clicks to Page Visits

user_events | user_id | event_time | event_type | ad_id | |---------|----------------------|------------|-------| | 1 | 2023-01-01 10:...

Data Manipulation (SQL/Python)
0
0
7 people solved
Aug 4, 2025
TikTok logo
TikTok
Medium
Data Scientist

Calculate Day-7 Retention Rate from User Post Data

post_activity +---------+------------+-------+ | user_id | post_date | posts | +---------+------------+-------+ | 1 | 2023-01-01 | 3 | | 1 ...

Data Manipulation (SQL/Python)
1
0
8 people solved
Aug 4, 2025
TikTok logo
TikTok
Medium
Data Scientist

Select 10% Users Randomly from User Table

users +----+----------+-------------+ | id | username | signup_date | +----+----------+-------------+ | 1 | alice | 2023-01-02 | | 2 | bob ...

Data Manipulation (SQL/Python)
0
0
5 people solved
Aug 4, 2025
TikTok logo
TikTok
Medium
Data Scientist

Tiktok DS Interview Questions

Scenario: You are provided with two tables: minute_streamed and minute_viewed. The minute_streamed table records each minute of streaming activity, wh...

Data Manipulation (SQL/Python)
11
1
83 people solved
Jun 26, 2025
TikTok logo
TikTok
Easy
Data Scientist

Write monthly customer and sales SQL queries

You are analyzing a food-delivery marketplace. Tables Assume the following schema (you may add minor helper CTEs as needed): orders - order_id (BIGINT...

Data Manipulation (SQL/Python)
6
4
84 people solved
Nov 27, 2025
TikTok logo
TikTok
Medium
Data Scientist

Write SQL for 7-day geo-localized revenue dashboard

Write a single SQL query (assume PostgreSQL; tz_offset is an integer hour offset from UTC) to compute a 7-day dashboard by local user date for US vs A...

Data Manipulation (SQL/Python)
0
0
9 people solved
Oct 13, 2025
TikTok logo
TikTok
Medium
Data Scientist

Compute and rank top bad advertisers

SQL on ad safety. Assume the following schema and sample rows. Use ANSI SQL. Today is 2025-09-01; interpret “last 7 days” as 2025-08-26 00:00:00 to 20...

Data Manipulation (SQL/Python)
2
0
10 people solved
Oct 13, 2025
TikTok logo
TikTok
Medium
Data Scientist

Write SQL for geo posting-frequency drops

Using the schema below, write a single ANSI SQL query (window functions allowed) that identifies countries with the largest share of creators whose po...

Data Manipulation (SQL/Python)
11
0
89 people solved
Oct 13, 2025
TikTok logo
TikTok
Medium
Data Scientist

Compute last-to-previous ad impression gaps

Given impressions(ad_id INT, user_id INT, impression_ts TIMESTAMP) with multiple impressions per (user_id, ad_id), write a single SQL query to return,...

Data Manipulation (SQL/Python)
0
0
3 people solved
Oct 13, 2025

Frequently Asked Questions

How difficult are TikTok Data Manipulation (SQL/Python) interview questions?
TikTok data manipulation questions are typically medium to hard in difficulty, reflecting real-world problems with large, messy logs and performance constraints. Expect SQL problems that require window functions, joins, CTEs, and careful handling of NULLs, plus Python tasks that test pandas skills and algorithmic thinking. Time pressure is common in online assessments and live coding rounds, so efficiency and clarity matter as much as correctness. Difficulty can vary by team and role: growth or analytics roles may focus more on SQL, while platform or infrastructure roles may push harder on Python and algorithmic optimization.
What is the typical interview process and where does data manipulation appear?
Data manipulation shows up in multiple stages of the TikTok interview loop. Many candidates encounter a timed online assessment with SQL exercises and short Python tasks, followed by live technical interviews that include whiteboard or shared-editor SQL problems, pandas scripting, and take-home or system-design exercises that involve ETL logic. Data manipulation questions also arise in case or product rounds where you need to reconstruct metrics or diagnose issues from sample logs. The exact placement depends on the role, but strong SQL and Python chops are evaluated repeatedly throughout the process.
How should I structure my interview preparation timeline for this topic?
A focused four-week timeline is effective: start by solidifying SQL fundamentals and writing clean, correct queries, then progress to advanced window functions, CTEs, and performance tuning. Parallel to SQL, build or refresh practical Python skills for data manipulation with pandas, emphasizing vectorized operations and memory awareness. In the final week, simulate timed assessments, run mock interviews, and practice explaining tradeoffs and edge cases aloud. Regularly review past mistakes, time yourself on typical problems, and rehearse succinct explanations of your approach to mirror the live interview setting.
What key subtopics should I master within Data Manipulation (SQL/Python)?
Master joins and set operations, grouping and aggregates, window functions, and CTEs, as well as the difference between filtering and HAVING and correct NULL handling. Performance basics such as indexing logic, avoiding unnecessary subqueries, and minimizing data shuffles are important for production-style questions. For Python, focus on pandas groupby and merge patterns, date and string manipulation, memory-efficient transformations, vectorization over loops, and robust handling of missing or duplicate data. Being able to translate a SQL solution into idiomatic pandas code is often evaluated directly.
What standout tips and common pitfalls should I keep in mind?
Start by clarifying assumptions and articulating edge cases before coding, and use small example inputs to validate logic quickly. Avoid premature optimization, but be mindful of performance and scalability for large datasets, for instance by preferring window functions or vectorized pandas operations to rowwise loops. Don’t ignore NULLs, duplicates, or timezone and date boundary issues when working with timestamps. When stuck, communicate your thought process and tradeoffs clearly. Common pitfalls include misinterpreting requirements, returning incorrect aggregates due to grouping mistakes, and writing non-scalable Python loops instead of vectorized solutions.

Explore more TikTok Data Manipulation (SQL/Python) interview questions

Real questions from candidate reports, grouped by role, topic and company.

By role
Other categories at TikTok
Data Manipulation (SQL/Python) questions at other companies
Browse all