Amazon Data Manipulation (SQL/Python) Interview Questions

Amazon Data Manipulation (SQL/Python) interview questions at Amazon focus on practical problem solving with real-world data: efficient joins and window functions in SQL, group and aggregate logic, NULL-handling and performance tradeoffs, and equivalent Pandas/NumPy patterns for in-memory work. What’s distinctive is the mix of product-sense and scale-awareness — interviewers evaluate both correctness and how your solution would behave on large tables or within a production pipeline. Expect timed live-coding or take-home tasks where clarity of assumptions, test cases, and incremental refinement matter as much as final syntax. For interview preparation, prioritize translating tasks between SQL and Pandas, practicing common subproblems (deduplication, rolling/window calculations, CTE refactors, and merge strategies), and explaining complexity and scalability tradeoffs. Be ready to justify index or partition choices, to optimize a slow query, and to narrate decisions with Amazon’s customer-and-ownership lens. Practicing with real datasets and mock interviews that simulate pressure will improve fluency and the concise communication Amazon looks for.

67 Questions 1 Company06.08.2026
Showing 20 results
Role
Amazon logo
Amazon
Medium
Data Scientist

Select Top Customers Using Transaction Data Filters

transactions +----+---------+------------+--------+ | id | user_id | order_date | amount | +----+---------+------------+--------+ | 1 | 101 | 202...

Data Manipulation (SQL/Python)
249
1
747 people solved
Aug 4, 2025
Amazon logo
Amazon
Medium
Data Scientist

Retrieve First Active and Last Inactive Dates per User

Given a table activity that tracks user activities, write a SQL query to retrieve the first active date and last inactive date for each user. Table Sc...

Data Manipulation (SQL/Python)
187
9
357 people solved
Aug 4, 2025
Amazon logo
Amazon
Medium
Data Scientist

Calculate Weekly, Monthly Watch Hours for Paid Users

video_view_logs +---------+----------+----------------+------------+------------+ | user_id | video_id | watched_seconds| watch_date | device_type| +-...

Data Manipulation (SQL/Python)
87
0
212 people solved
Jul 12, 2025
Amazon logo
Amazon
Medium
Data Scientist

Identify First Daily Order for Each Merchant

Orders +----------+-------------+---------+------------+ | order_id | merchant_id | amount | order_date | +----------+-------------+---------+-------...

Data Manipulation (SQL/Python)
76
0
274 people solved
Jul 12, 2025
Amazon logo
Amazon
Medium
Business Intelligence Engineer

Identify Unique Unordered City Pairs in Flight Log

FLIGHTS +----------------+---------------+ | departure_city | arrival_city | +----------------+---------------+ | NYC | LAX | | ...

Data Manipulation (SQL/Python)
3
0
3 people solved
Jul 12, 2025
Amazon logo
Amazon
Medium
Business Intelligence Engineer

Illustrate SQL Join Results with Duplicate Keys

TABLE1 +------+ | col1 | +------+ | 1 | | 1 | | 1 | +------+ ​ TABLE2 +------+ | col1 | +------+ | 1 | | 1 | | 1 | | 1 | | 1 |...

Data Manipulation (SQL/Python)
8
0
17 people solved
Jul 12, 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
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
Amazon logo
Amazon
Medium
Data Scientist

Append country tables and rank salaries in USD

You have separate country-level employee tables that must be appended and ranked by salary converted to USD using an exchange rate table. SQL schema a...

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

Transform event logs with subscription windows in pandas

Using pandas, compute user-level subscription-aligned revenue and anomalies for September 2025. DataFrames: events(user_id:int, ts:UTC datetime, event...

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

Compute daily work hours from in/out events

Given punch events, compute each employee’s daily hours, handling unmatched events and overnight shifts. Write SQL over: events(employee_id INT, evt_t...

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

Calculate cross-channel login user proportions

Write SQL to compute, for 2025-08-29 through 2025-08-31, the proportion of users who logged in only via mobile, only via desktop, and via both, where ...

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

Find returning users from access logs

Given a large user access log, parse it and identify which user_ids are returning customers—i.e., they have at least one visit on two or more distinct...

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

Find Top-3 Salaries Per Department Using SQL

employees +----+---------+--------+---------+ | id | name | salary | dept_id | +----+---------+--------+---------+ | 1 | Alice | 120000 | 10 ...

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

Create SQL Queries for Sales and Customer Analysis

SALES +----------+----------+------------+------------+----------+---------+ | sale_id | store_id | product_id | sale_date | quantity | revenue | +-...

Data Manipulation (SQL/Python)
0
0
6 people solved
Aug 4, 2025

Frequently Asked Questions

How difficult are Amazon Data Manipulation (SQL/Python) interview questions?
At Amazon, Data Manipulation (SQL/Python) questions range from basic SELECTs to complex window-function and multi-join puzzles. For entry-level roles you can expect medium-difficulty tasks such as filtering, aggregates, and simple joins, while mid-to-senior positions commonly include hard problems that require multi-step transforms, efficient windowing, common-table expressions, and memory-aware pandas code. Interviewers evaluate correctness, performance, and clarity of thought; minor syntax slips can be forgiven if reasoning is solid, but inefficiency or incorrect handling of NULLs and edge cases will lower your score. Time pressure and follow-up tradeoff questions often increase perceived difficulty.
Where in the Amazon interview process does Data Manipulation (SQL/Python) appear and how is it assessed?
Data Manipulation skills appear in several stages of an Amazon interview loop. Recruiter screens may include high-level questions, technical phone or video screens often use a collaborative editor for live SQL or pandas exercises, and on-site interviews or take-home assignments require writing production-quality queries and scripts. Different roles emphasize different aspects: analysts focus on aggregations and joins, data engineers evaluate scalability and query optimization, and data scientists mix transformation with modeling needs. Assessment typically covers correctness on sample data, efficiency considerations for large datasets, and your ability to explain assumptions and tradeoffs.
What is a realistic preparation timeline for Data Manipulation (SQL/Python) for Amazon interviews?
A focused four-to-eight week plan is realistic for most candidates. Begin with two weeks of fundamentals covering SQL joins, aggregates, window functions, CTEs, and pandas groupby/merge/vectorized operations. Spend the next two weeks solving timed problems that combine multiple transformation steps and practice writing efficient queries. Use the final weeks for mock interviews, end-to-end exercises on realistic datasets, and review of edge cases like NULLs, duplicates, and memory limits. Throughout, prioritize explaining your approach, reviewing mistakes, and rehearsing tradeoff discussions rather than only chasing quantity of problems.
What key subtopics should I master within Data Manipulation (SQL/Python) for Amazon interviews?
Master joins and data modeling choices, aggregate functions versus HAVING, and window functions for ranking and running metrics. Learn to use CTEs for stepwise transformations and be fluent in NULL handling, date and string manipulation, and grouping semantics. In Python and pandas, focus on merges, groupby-apply or transform patterns, pivoting and reshaping, vectorized operations to avoid slow loops, and using appropriate data types to save memory. Equally important is performance tuning: understand explain plans, indexing and partitioning basics, and when it’s better to push logic into SQL versus handling it in Python.
What standout tips and common pitfalls should I be aware of when preparing for Data Manipulation (SQL/Python) at Amazon?
Begin by clarifying requirements and state any assumptions; communication is part of the evaluation. Choose the tool that makes your solution clearer and more efficient, and be ready to justify that choice. Common pitfalls include ignoring NULL semantics, misordering joins causing row multiplication, using row-by-row operations in pandas instead of vectorized approaches, and overlooking performance implications on large tables. Always consider edge cases, write readable SQL or Python, and if optimization is needed explain indexing, partitioning, or vectorization strategies rather than attempting risky micro-optimizations under time pressure.

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

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

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