ByteDance Data Manipulation (SQL/Python) Interview Questions
Master your tech interview with our curated database of real questions from top companies.
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...
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...
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...
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...
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...
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...
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...
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...
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...