Data Manipulation (SQL/Python) Interview Questions

Practice 717 real SQL and Python data manipulation interview questions asked at Meta, Amazon, TikTok, DoorDash and Capital One. The shapes that recur are multi-table joins (INNER and LEFT, plus anti-joins for finding what is missing), GROUP BY with HAVING against WHERE, IN and NOT IN, EXISTS, DISTINCT and deduplication, CASE WHEN pivots, UNION, and window functions such as ROW_NUMBER, RANK, LAG and LEAD for ranking, running totals and period-over-period change. NULL handling runs underneath all of it: COALESCE, NOT IN against a nullable column, outer joins that quietly drop rows. Many questions take a pandas answer instead, built from merge, groupby, pivot_table and shift. 606 of them open in a PostgreSQL console where you can run your query against the real tables before looking at the solution. 550 come from Data Scientist loops, and nine in ten are asked in a technical screen or onsite round.

717 Questions 117 Companies09.22.2026
Showing 17 results

Frequently Asked Questions

How difficult are Data Manipulation (SQL/Python) interview questions?
Data Manipulation (SQL/Python) interview questions range from basic to advanced. Entry-level questions test filtering, joins, simple aggregates and pandas groupby, while mid and senior roles push multi-table joins, window functions, deduping, time-series alignment, null-handling, and performance trade-offs. Interviewers at companies that weight this category heavily, such as Meta, Amazon and TikTok, look for correctness, edge-case thinking, readable code, and clear trade-off explanations. The challenge is rarely obscure syntax; it is turning an ambiguous product or metric prompt into a robust query or transformation that scales and survives messy, real-world data.
Where in a typical interview loop does data manipulation appear and what formats should I expect?
Data manipulation shows up across the loop: initial technical screens often include 30 to 60 minute live SQL or Python problems, take-home assignments use Jupyter or SQL editors for end-to-end cleaning and analysis, and on-site rounds dedicate 45 to 60 minutes to deeper problems that combine query writing with product framing or A/B test interpretation. Companies such as DoorDash, Capital One and Meta commonly place heavy emphasis on this category in both phone screens and loop rounds. Expect a mix of live coding, whiteboard-style reasoning about schemas, and short conversations where you must justify assumptions and performance choices.
How long should I prepare for data manipulation interviews?
Preparation time depends on baseline skill and target company. If you already write SQL and pandas daily, focused sharpening of edge cases and timed practice for two to six weeks often suffices. Candidates aiming at heavily SQL-weighted loops at Meta, Amazon or other top firms typically plan six to twelve weeks to rebuild pattern recall, drill window functions, and rehearse product-driven questioning. Prioritize active practice: solve real-schema SQL problems, build small Python notebooks that replicate common ETL steps, simulate timed screens, and do a few mock interviews to practice explaining assumptions under pressure.
What are the key subtopics I must master in SQL and Python for data manipulation rounds?
Master the basics first: joins, aggregations, GROUP BY semantics, and filtering versus HAVING. Move to window functions for ranking, lead/lag and cumulative metrics, and CTEs for readable stepwise transformations. Handle nulls, deduplication, time alignment, string parsing and timezone-aware date arithmetic. In Python focus on pandas groupby, merges, pivoting, boolean indexing, rolling computations and writing clean, vectorized code. Also understand performance considerations: explain why you choose SQL versus Python for a particular workload and how to reduce row explosion or costly cross joins when working with real datasets.
What standout tips and common pitfalls should I watch for during interviews?
Always start by clarifying the metric, sample schema, and edge cases, and sketch expected sample output before coding. Use small example rows to validate logic and state assumptions about nulls, duplicates, and timezones. Prefer readable CTEs or well-commented pandas steps over one-line cleverness. Watch common pitfalls such as double-counting from incorrect joins, applying HAVING instead of WHERE, off-by-one window boundaries, and failing to dedupe before aggregation. Finally, communicate complexity and trade-offs: explain how your solution handles scale, when you would push work into the warehouse, and what tests you would run in production.

Explore more Data Manipulation (SQL/Python) interview questions

Jump straight to Data Manipulation (SQL/Python) questions at a specific company or for a specific role.

By company
By role