Data Scientist Data Manipulation (SQL/Python) Interview Questions

Practice 550 real Data Manipulation (SQL/Python) interview questions for Data Scientist roles. From companies including Meta, Amazon, TikTok, Capital One, DoorDash.

550 Questions 84 Companies08.03.2026
Showing 20 results
Role
Amazon logo
Amazon
Medium
Data Scientist

Find top-spend categories per customer with ranking

Using the schema and sample data below, write a single ANSI SQL query (CTEs allowed; no temp tables) that returns, for each customer, their top 2 prod...

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

Compute unread and multi-account user percentages

You’re given two tables. Write ANSI-SQL to answer parts (a)–(d). Treat a notification as unread if read_at IS NULL. Denominator for user-level percent...

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

Compute monthly CRR with merges and gaps

You are given PostgreSQL tables user_profile(user_id, signup_ts, country, is_employee, is_test), user_events(user_id, event_ts, event_type, revenue, p...

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

Compute survey rates and bias-correct ratings

Today is 2025-09-01. Use the schema and sample data below to answer A and B with SQL (standard SQL; you may use CTEs and window functions). Assume tim...

Data Manipulation (SQL/Python)
3
0
55 people solved
Oct 13, 2025
Google logo
Google
Medium
Data Scientist

Deduplicate events and rank products with SQL

You are given two tables. Schema: - events(event_id INT PRIMARY KEY, user_id INT, product_id INT, event_time TIMESTAMP, idempotency_key TEXT, amount_c...

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

Write SQL for hashtag analytics and joins

Assume today = 2025-09-01. Schema and small sample data are below. Use ANSI SQL; explain any dialect-specific functions you choose. Where asked, expla...

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

Write SQL to localize anomaly and funnel

Given the schema and toy data below, write SQL to (a) validate instrumentation vs behavior change, (b) localize the 2025-09-01 Likes drop by app_versi...

Data Manipulation (SQL/Python)
0
0
5 people solved
Oct 13, 2025
CVS Health logo
CVS Health
Medium
Data Scientist

Aggregate radiology spend and derive fiscal month

Using Python/pandas, complete the tasks below. Assume the following CSV-like input, where service_dt is object dtype and amounts may be negative (adju...

Data Manipulation (SQL/Python)
0
0
8 people solved
Oct 13, 2025
Voleon Group logo
Voleon Group
Medium
Data Scientist

Analyze time-zoned events with pandas

You are given two pandas DataFrames. events columns: user_id:int, ts:str ISO-8601 with timezone (e.g., '2025-08-31T23:58:43-07:00'), event:str in {'si...

Data Manipulation (SQL/Python)
16
0
257 people solved
Oct 13, 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
Amazon logo
Amazon
Medium
Data Scientist

Transform retail data with pandas groupby/merge/concat

Using pandas only (groupby/agg/merge/concat; no for-loops), write code to answer the sub-questions below on the following small dataframes. Assume tim...

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

Label new vs old users over time in SQL

Define users as “new” during the first 30 days inclusive after their signup_date, and “old” thereafter. Produce per-user, per-day labels over a window...

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

Write SQL to compute max-overlap lists

Invented schema and sample data below. Assume 'today' is 2025-09-01 and 'last 7 days' means 2025-08-26 through 2025-09-01 inclusive. Only consider lis...

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

Write SQL for engagement and attribution KPIs

Using the schema and sample data below, answer the SQL tasks. Assume timestamps are UTC and comments with is_deleted=1 do not count. Schema: users(use...

Data Manipulation (SQL/Python)
1
0
8 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
Google logo
Google
Medium
Data Scientist

Implement R dplyr simulation and left join

Using R and dplyr, run a simulation and a join. Data: prices item_id | price_usd 1 | 10.00 2 | 20.00 3 | 30.00 4 | 40.00 catalog item_id | category 1 ...

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

Verify subscriptions and analyze orders with SQL/Python

You are given two tables. Write SQL and Python (pandas) to answer the sub-questions precisely, handling edge cases, ties, and missing data. Schema - s...

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

Calculate posts per DAU by country today

Given two tables: - user_activity(user_id INT, activity_date DATE, country STRING, dau_flag TINYINT CHECK(dau_flag IN (0,1))) - composer(user_id INT, ...

Data Manipulation (SQL/Python)
4
0
42 people solved
Oct 13, 2025
Meta logo
Meta
Medium
Data Scientist

Compute daily post success rate for last 7 days

You have a table composer(user_id INT, event STRING CHECK(event IN ('enter','post','cancel')), event_date DATE). Compute the post success rate for eac...

Data Manipulation (SQL/Python)
7
1
45 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

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

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

By company
Other categories for Data Scientist
Data Manipulation (SQL/Python) questions for other roles
Browse all