Amazon Data Manipulation (SQL/Python) Interview Questions
Master your tech interview with our curated database of real questions from top companies.
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...
Select Top Customers Using Transaction Data Filters
transactions +----+---------+------------+--------+ | id | user_id | order_date | amount | +----+---------+------------+--------+ | 1 | 101 | 202...
Identify Top Spenders and Segment Customers Using Python
orders +----------+---------+------------+----------+--------------+-------------------+ | order_id | cust_id | order_date | product | order_amount |...
Analyze User Engagement with SQL Queries
events +----------+---------+---------------------+ | event_id | user_id | event_time | +----------+---------+---------------------+ | 1 ...
Understand SQL: DELETE vs TRUNCATE, VIEW vs TABLE, CROSS JOIN
employees +----+--------+---------+ | id | name | dept_id | +----+--------+---------+ | 1 | Alice | 10 | | 2 | Bob | 20 | | 3 | Car...
Calculate Weekly, Monthly Watch Hours for Paid Users
video_view_logs +---------+----------+----------------+------------+------------+ | user_id | video_id | watched_seconds| watch_date | device_type| +-...
Design Incremental Load Process for Large Relational Table
orders_daily_load +------------+-----------+-------------+--------+ | load_date | order_id | customer_id | amount | +------------+-----------+------...
Explore Subscription Patterns and Status Transitions with SQL/Pandas
subscriptions +-----------------+---------+-------------+ | subscription_id | status | status_date | +-----------------+---------+-------------+ | 10...
Identify Date with Highest Total kWh Consumption Using Pandas
meter_readings +----------+------------+---------------+---------+ | meter_id | timestamp | kwh_consumed | city | +----------+------------+------...
Analyze Monthly Prime vs Non-Prime Sales and Price Buckets
sales +-----------+------------+----------+-------+ | order_id | order_date | is_prime | price | +-----------+------------+----------+-------+ | 1001...
Create Country-Level Spend Report Using Pandas
users +---------+---------+ | user_id | country | +---------+---------+ | 1 | US | | 2 | CA | | 3 | US | +---------+-...
Identify SQL Joins and Correct Query Errors
Winner +----+-------+ | ID | Name | +----+-------+ | 1 | Alice | | 2 | Bob | | 3 | Carol | +----+-------+ Loser +----+-------+ | ID | Name | ...
Compute 3-Day Rolling Revenue Averages with Pandas
sales +------------+-----------+-------+---------+ | date | product_id| units | revenue | +------------+-----------+-------+---------+ | 2023-01...
Explain MySQL to MS SQL Server query syntax differences.
transactions | id | user_id | amount | txn_date | |----|---------|--------|----------| | 1 | 1001 | 25.00 | 2023-07-01 | | 2 | 1002 | 40.00 ...
Calculate Defect Rate and Identify Top Lanes for Carriers
shipment +-------------+----------+-----------+---------+---------+-------------+-----------+ | shipment_id | order_id | ship_date | carrier | origin ...
Consolidate and Rank Global Salaries in USD
employees_us +---------+----------+--------+---------+ | emp_id | name | salary | country | +---------+----------+--------+---------+ | 1 |...
Identify First Daily Order for Each Merchant
Orders +----------+-------------+---------+------------+ | order_id | merchant_id | amount | order_date | +----------+-------------+---------+-------...
Analyze Top 10 Items' Revenue Contribution by Category
sales +----------+------------+---------+---------+------------+ | order_id | category | item_id | revenue | order_date | +----------+------------+-...
Identify Top-Buying Customers Daily with SQL Query
PRIME +-------------+------------+----------+ | Customer_ID | Start_Date | End_Date | +-------------+------------+----------+ | 1 | 2025-01-...
Identify Top-Buying Customers Daily with SQL Query
PRIME +-------------+------------+----------+ | Customer_ID | Start_Date | End_Date | +-------------+------------+----------+ | 1 | 2025-01-...