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
Pinterest logo
Pinterest
Medium
Data Scientist

Find top category by video time spent

Pandas required. You are given a DataFrame df with columns: user_id (int), pin_id (int), pin_type (str), category (str or None), time_spent_sec (numer...

Data Manipulation (SQL/Python)
18
0
140 people solved
Oct 13, 2025
Capital One logo
Capital One
Medium
Data Scientist

Merge CSVs and build revenue pivot with pandas

You receive four CSVs and must replicate an Excel VLOOKUP + PivotTable workflow using Python/pandas. CSV samples: customers.csv customer_id,signup_dat...

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

Find top category per region in Aug 2025

You are given the following schema and sample data. Schema: - customers(customer_id INT, name TEXT, region TEXT) - orders(order_id INT, customer_id IN...

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

Write SQL for video-call recipients and FR activity

Given the schema and samples below, write ANSI‑SQL to answer both questions. Assume dates are stored in UTC. Today is 2025-09-01, so “yesterday” is 20...

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

Write SQL/pandas for KPI anomaly

Write SQL (and outline equivalent pandas) for a KPI anomaly investigation. Assume today = '2025-09-01'. Schema: Users(user_id INT, country TEXT, signu...

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

Write SQL for daily chats and fast replies

You are given a messaging events table that records one row per message sent. Schema - messages( date DATE, -- calendar date of event (UTC) ts TIMES...

Data Manipulation (SQL/Python)
3
0
4 people solved
Oct 13, 2025
Capital One logo
Capital One
Medium
Data Scientist

Write SQL for theme-park revenue and visits

You are given theme-park ticketing and visits data. Write SQL to answer the following, using the sample schema and tables below. Return both the query...

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

Write SQL to monitor weekly chargeback spikes

Write a single SQL query (PostgreSQL) to detect weekly chargeback spikes by country and industry. Week starts Monday (use date_trunc('week', ts) with ...

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

Generate binomial matrix and column-normalize

Using Python with NumPy, generate a 100×100 matrix of Binomial(n = 10, p = 0.3) draws with a fixed random seed, then normalize each column so it sums ...

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

Write SQL for hashtag source and safety rates

Write SQL for the two tasks below. Assume the schema and sample data as given, and that “today” is 2025‑09‑01. Deduplicate exact duplicates by (date, ...

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

Find daily first-order merchants with SQL

Given the table below, write a single SQL query using window functions to: A) For each calendar date (UTC), return all merchant_id(s) whose order is t...

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

Design student–course data models and SQL

Scenario: Model a university domain with Students, Courses, Departments, Instructors, and Enrollments. Tasks: 1) OLTP ERD: Specify normalized tables w...

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

Design idempotent daily loads with deduping

You need to load the last 7 days of orders into a large fact table from a noisy staging feed. Assume today is 2025-09-01. Requirements: idempotent rer...

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

Write SQL filtering, grouping, CASE, UNION tasks

Use the following schema and sample data to answer all parts. Assume standard ANSI SQL and that amounts are DECIMAL. Table: orders +----------+-------...

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

Diagnose MySQL joins and GROUP BY/HAVING errors

You are using MySQL 8.0 with ONLY_FULL_GROUP_BY enabled. Answer all parts precisely. Provide the exact SQL you would run and the final result shapes/v...

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

Assess SQL joins, unions, windows, dedup, and pandas

Using the schema and sample data below, answer all sub-questions. Unless stated, assume ANSI SQL and explain any dialect-specific choices. Schema: - c...

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

Query and transform marketplace data in SQL/Python

Assume today is 2025-09-01. Use the following schema and sample data to answer the questions with both SQL (preferred) and equivalent Python (pandas) ...

Data Manipulation (SQL/Python)
0
0
4 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
Point72 logo
Point72
Medium
Data Scientist

Convert integer dates to quarters

Given an 8-digit integer date_key in YYYYMMDD (e.g., 20240331), write: (a) a SQL expression and (b) a Python function that convert it to a quarter lab...

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

Write SQL for deliveries analytics

Write SQL for the following analytics tasks. Assume a PostgreSQL-like dialect unless otherwise stated. Treat "today" as 2025-09-01. Schema: - users(us...

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