Skip to content
AssistedVoice
SQL interviews

Write the query, then handle the ties

A live SQL screen is 45–75 minutes in a shared editor, often one where you can’t run the query. The interviewer reads your logic, then adds ties, NULLs and scale. Capture the question and the Code tab gives an approach and a working query.

No credit card 30 minutes free Encrypted
Example: with a screenshot of “Top 3 products by revenue in each category. Tied products share a rank.” attached, the Code tab answers with this approach: Total revenue per product first, then rank inside each category with DENSE_RANK, so tied products share a rank and every product in the top three totals comes back. RANK would stop at three plus ties; ROW_NUMBER returns exactly three.

Three places SQL gets tested

A timed test, a live screen, then onsite rounds where SQL sits next to metrics, data modelling or Python. Assisted Voice is for the live rounds only.

  1. Timed SQL test

    Length
    30–110 min
    30 minutes for a Google business analyst test, and 70 minutes with 8 questions for a Swiggy business analyst one. One Amazon Data Engineer I candidate reports a 110-minute SQL section. Amazon gives BIE candidates 7 days to complete theirs. Amazon Jobs (opens in a new tab); LinkedIn, 2025 (opens in a new tab); Reddit, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab)
    What happens
    Timed queries, sometimes with multiple-choice questions on SQL. Amazon’s BIE assessment has three parts, SQL Challenge, Working with SQL and Work Styles, and candidates report 2–4 coding questions in it. Amazon Jobs (opens in a new tab); Reddit, 2025 (opens in a new tab); Reddit, 2025 (opens in a new tab)
    Assisted Voice
    Not for this. Assisted Voice is for live video-call rounds, not timed or proctored tests.
  2. Live screen

    Length
    45–75 min
    Amazon’s guide lists its BIE screen at 60 minutes; candidates report 75, with 2–3 SQL questions. Meta’s data engineer screen is 60 minutes, about 25 of them SQL. One Uber Freight business analyst had 3–4 questions in 45 minutes. Amazon Jobs (opens in a new tab); Reddit, 2025 (opens in a new tab); Reddit, 2025 (opens in a new tab); Medium, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); Reddit, 2025 (opens in a new tab)
    What happens
    You write queries in a shared editor and explain your reasoning as you go. Amazon mixes in Leadership Principle questions, and Meta’s data engineer screen splits the hour between SQL and Python. Amazon Jobs (opens in a new tab); Reddit, 2025 (opens in a new tab); Medium, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab)
    Assisted Voice
    Built for this, on Zoom, Google Meet or Microsoft Teams. Capture the question and the Code tab gives an approach and a working query.
  3. Onsite round

    Length
    About 55–60 min
    Amazon’s BIE loop is five 55-minute interviews, with “SQL and basic scripting” as a named competency. Each of Meta’s three 1-hour data engineer interviews has about 15 minutes of SQL. Amazon Jobs (opens in a new tab); Medium, 2025 (opens in a new tab)
    What happens
    Harder multi-table problems with follow-ups on edge cases and performance, or metrics you define for a product scenario and then compute. Reddit, 2025 (opens in a new tab); Reddit, 2025 (opens in a new tab); Medium, 2025 (opens in a new tab)
    Assisted Voice
    The same, when the round runs over video. Not for in-person rounds.

Often, you can’t run it

Candidates write SQL in a doc, CoderPad or a plain editor, and the interviewer judges the logic, not the output. Reddit, 2025 (opens in a new tab); Reddit, 2025 (opens in a new tab); Reddit, 2025 (opens in a new tab); Reddit, 2025 (opens in a new tab)

What interviewers say

You can’t run it

You can run it

Editor and dialect

Practise without a Run button

A reported slip is practising only in tools that run the query, then freezing in an editor that doesn’t. One Amazon BIE candidate spent about 50 minutes on two questions this way. Reddit, 2025 (opens in a new tab); Reddit, 2025 (opens in a new tab)

After the first query come the follow-ups

Candidates report the same follow-ups again and again. One prep guide’s routine matches them: clarify, write, test, then expect a question about an index, a much larger table, a schema change or ties. TradeoffRound (opens in a new tab)

  1. Ties

    Two products have the same revenue. Which ones come back?

    ROW_NUMBER keeps exactly three and cuts ties arbitrarily. RANK lets tied rows share a rank and then skips; DENSE_RANK shares without gaps. Say which one the question needs before you write it.

    Reported at Amazon BIE (a Blind post), Flipkart BA and Walmart DE. Blind, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab)

    Three ways to rank
    -- exactly 3; ties cutROW_NUMBER()-- ties share, then a gapRANK()-- ties share, no gapDENSE_RANK()
  2. Messy data

    Some rows are duplicates, and the timestamps are in UTC.

    Duplicates and local-time boundaries are built into questions on purpose. Deduplicate with ROW_NUMBER and keep the first copy. A prep course also warns about joins that multiply rows and inflate SUM totals.

    Reported at Uber DS and Flipkart BA. Medium, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); DataInterview (opens in a new tab)

    What changes in the query
    -- keep the first copy of each rowWHERE rn = 1-- local time, Postgres timestamptzsold_at AT TIME ZONE 'Asia/Kolkata'
  3. NULLs

    Some of these values are NULL. What changes?

    NOT IN returns no rows when its subquery contains a NULL, and COUNT(column) skips the NULLs that COUNT(*) counts. Reports mention NULL fares and NULLs across joined tables.

    Reported at Walmart DE, Amazon DE, Uber DS and CommerceIQ SDE-1. LinkedIn, 2025 (opens in a new tab); Medium, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); Medium, 2025 (opens in a new tab)

    The trap, and the fix
    -- no rows if the list has a NULLNOT IN (SELECT ...)-- unaffected by NULLsNOT EXISTS (SELECT ...)-- different totalsCOUNT(*)  vs  COUNT(fare)
  4. Scale

    The table has 100 million rows. Does this still work?

    Expect to talk through how the query behaves at much larger scale, or to tune a slow query you’re handed.

    Reported at Walmart DE, Amazon DE, Swiggy Instamart BA and an undated Amazon BIE account. Reddit, 2025 (opens in a new tab); Medium (opens in a new tab); LinkedIn, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab)

    Where to start
    -- read the plan before you tuneEXPLAINSELECT ...
  5. Indexes

    Would an index help here? Could one make it slower?

    Indexing strategy and when an index hurts, separate versus composite indexes for a two-column filter, B-tree versus B+ tree, and reading query plans.

    Reported at Flipkart BA, a Zomato SDE intern, DE Shaw and CommerceIQ SDE-1. LinkedIn, 2025 (opens in a new tab); LeetCode Discuss, 2025 (opens in a new tab); LeetCode Discuss, 2024 (opens in a new tab); Medium, 2025 (opens in a new tab)

    Two indexes, or one
    -- two single-column indexesINDEX (category_id)INDEX (sold_on)-- or one composite indexINDEX (category_id, sold_on)
  6. Another tool

    Now write the same logic in PySpark.

    Walmart data engineer candidates report solving problems in SQL first, then again in Spark or the PySpark DataFrame API.

    Reported at Walmart DE. LinkedIn, 2025 (opens in a new tab); Reddit, 2025 (opens in a new tab)

    The same ranking in PySpark
    F.dense_rank().over(  Window.partitionBy("category_id")        .orderBy(F.desc("total")))

At every step, say why

One Meta data engineer candidate was asked to justify every line and offer alternatives. An Amazon BIE candidate advises saying why each join or window was chosen, and how many rows you expect. Blind, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab)

With Assisted Voice: For spoken follow-ups like “would an index help?”, press the answer shortcut for a first-person answer you can say in your own words. When the query itself has to change, capture the question again and the Code tab gives an approach and a working query.

Same SQL, four different rounds

Analyst and data-science rounds start from a business question and judge whether your query answers it. Data engineer rounds ask for more queries, faster. Backend rounds use a short query to get to indexes and transactions.

What each company’s SQL covers

Ranking and window functions come up at Amazon, Flipkart, Swiggy and Walmart. What surrounds them depends on the company and the role. Reddit, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab)

Individual candidate reports and published process pages, not official policy. Formats change by team and year.
CompanyWhat candidates were askedSource
AmazonBIE and data engineer, 2025Joins, window functions, top-K, rolling averages, year-over-year and month-over-month growth, and churn. Also CTEs with NULL handling across tables, ranking with ties, and dashboard metrics you define and then query. An undated, older account adds explaining join types and fixing a query that won’t compile. Amazon’s remote-interview page says interviews run on Zoom or Amazon Chime; Assisted Voice works on Zoom, not Chime. Business Insider reported internal guidelines telling candidates not to use GenAI tools during interviews unless explicitly permitted.Reddit, 2025 (opens in a new tab); Blind, 2025 (opens in a new tab); Reddit, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); Medium (opens in a new tab); Amazon Jobs (opens in a new tab); Business Insider, 2025 (opens in a new tab)
MetaData engineer and data scientist, 2025Several schemas, each with a series of analytical questions that get harder. Two data engineer reports describe a bookstore star schema, a sales fact with book and author dimensions, using GROUP BY, SUM(CASE …), HAVING and CTEs. Data-science screens pair product-metric questions with SQL. Meta’s hiring FAQ says outside AI tools aren’t allowed; only the tools inside its interview environment may be used.Medium, 2025 (opens in a new tab); Blind, 2025 (opens in a new tab); Taro, 2025 (opens in a new tab); Reddit, 2025 (opens in a new tab); Meta Careers (opens in a new tab)
UberData scientist and Freight business analyst, 2025Time-zone conversion, deduplication, NULL fares and COUNT DISTINCT in one DS II screen. One DS SQL round had 2 medium questions and 1 hard; one Freight business analyst round had 3–4 questions in 45 minutes.Reddit, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); Medium, 2025 (opens in a new tab)
GoogleTechnical Solutions Consultant and business analyst, 2025Joins, window logic, unique-user counts and time-based queries in one business analyst test. A new-grad TSC round had two sets of three questions, rated medium-to-hard and easy-to-medium. Google’s virtual-interview guide says using AI during an interview means disqualification.LinkedIn, 2025 (opens in a new tab); Reddit, 2025 (opens in a new tab); Google (opens in a new tab)
FlipkartBusiness analyst, 2025Window versus aggregate functions, indexing strategy and when an index slows things down, 30-day activity windows, top 3 per category and deduplication, from one widely reposted question list. One other report describes a gaps-and-islands problem on consecutive seats.LinkedIn, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab)
SwiggyBusiness and data analyst, 2025Joins, window functions, CTEs and recursive CTEs for a business analyst. CTEs, self-joins, tuning a given query, maximum salary per department and CROSS versus OUTER joins at Instamart. Join types, COUNT with HAVING, date-range filters, DENSE_RANK and DELETE versus TRUNCATE in a data analyst list.LinkedIn, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab)
WalmartData engineer, 2025RANK, LEAD, LAG and complex joins, then the same logic in Spark. Reported questions include the second-latest purchase per user, top 3 per region, NOT IN with NULLs, and tuning over more than 100 million rows.LinkedIn, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); Reddit, 2025 (opens in a new tab)

SQL questions candidates were asked

  • Top 3 products per category, or by revenue per region, and how ties are handled (Flipkart BA, Walmart DE, Amazon BIE)
  • Second-latest purchase per user, or second-highest salary with DENSE_RANK (Walmart DE, Swiggy DA)
  • Customers active in the last 30 days but not the 30 days before (Flipkart BA)
  • Remove duplicate rows, keeping the first, with ROW_NUMBER (Flipkart BA, Uber DS)
  • Month-over-month or year-over-year growth with LAG, and rolling averages (Amazon DE and BIE)
  • Maximum salary per department, and CROSS versus OUTER joins (Swiggy Instamart BA)
  • More than three consecutive seats meeting a condition, a gaps-and-islands problem (Flipkart BA, one report)
  • First login per user, and rows in table A that aren’t in table B (DE Shaw, backend)

Where candidates slip

  • Practising only where queries run, then freezing in an editor that doesn’t. One Amazon BIE candidate spent about 50 minutes on two questions.
  • Running out of time on the last, hardest question. One Uber DS candidate names it as the reason for their rejection.
  • Missing messy data: duplicate records, NULL fares, UTC versus local time, and NOT IN returning nothing when the subquery has a NULL.
  • Joins that multiply rows and inflate SUM totals, a trap one prep course warns about.
  • Over-complicating with subqueries or window functions you don’t need, in one Swiggy business analyst candidate’s advice.
  • Forgetting basic syntax such as CASE under pressure, in one Infosys candidate’s account.
FAQ

Questions, answered

Contact us
  • SQL is tested in three places: a timed online test, a live screen of about 45 to 75 minutes where you write queries in a shared editor and explain them, and onsite rounds where SQL sits next to metrics, data modelling or Python. Expect follow-ups on ties, NULLs, duplicates and performance.

Sources

Last reviewed . Candidate reports are paraphrased, and formats vary by team, location and year.

  1. Business Intelligence Engineer interview prepAmazon Jobs (opens in a new tab)
  2. Amazon BI engineer L5 interview experience (r/amazonemployees)Reddit, 2025 (opens in a new tab)
  3. Interviewing for an L5 BIE role at Amazon (r/interviews)Reddit, 2025 (opens in a new tab)
  4. A 75-minute Amazon BIE phone screen (r/amazonemployees)Reddit, 2025 (opens in a new tab)
  5. Amazon Business Intelligence Engineer L5 interview, 2025Blind, 2025 (opens in a new tab)
  6. Amazon Data Engineer L5 interview experience (r/dataengineering)Reddit, 2025 (opens in a new tab)
  7. Amazon Data Engineer I interview experience: assessment and phone screenLinkedIn, 2025 (opens in a new tab)
  8. An Amazon data engineering SQL interview with three complex queriesLinkedIn, 2025 (opens in a new tab)
  9. Landing a Business Intelligence Engineer L5 role at AWSMedium (opens in a new tab)
  10. Meta Data Engineer interview experience, 2025Medium, 2025 (opens in a new tab)
  11. Meta Data Engineer (Analytics) interview experienceLinkedIn, 2025 (opens in a new tab)
  12. A Meta Data Engineer interview experience threadBlind, 2025 (opens in a new tab)
  13. Meta Data Engineer interview, New York, March 2025 (no offer)Taro, 2025 (opens in a new tab)
  14. Recent interviews for Meta’s data scientist, product analytics role (r/datascience)Reddit, 2025 (opens in a new tab)
  15. Meta data scientist interview guideDataLemur, 2025 (opens in a new tab)
  16. Uber Freight SQL interview round (r/leetcode)Reddit, 2025 (opens in a new tab)
  17. Uber Data Scientist interview: the SQL roundLinkedIn, 2025 (opens in a new tab)
  18. Lessons from Uber’s data scientist interview: SQL, Python and A/B testingMedium, 2025 (opens in a new tab)
  19. Google Technical Solutions Consultant interview experience (university graduate)LinkedIn, 2025 (opens in a new tab)
  20. SQL interview for Google (r/leetcode)Reddit, 2025 (opens in a new tab)
  21. Rejected after a perfect SQL assessment at Google (r/SQL)Reddit, 2025 (opens in a new tab)
  22. Flipkart Business Analyst SQL and Python interview questions (a widely reposted list)LinkedIn, 2025 (opens in a new tab)
  23. A Flipkart business analyst SQL question on consecutive seatsLinkedIn, 2025 (opens in a new tab)
  24. Swiggy business analyst interview: SQL self-assessment and technical roundLinkedIn, 2025 (opens in a new tab)
  25. Swiggy Instamart business analyst interviewLinkedIn, 2025 (opens in a new tab)
  26. Swiggy data analyst interview questionsLinkedIn, 2025 (opens in a new tab)
  27. Walmart Senior Data Engineer interview experienceLinkedIn, 2025 (opens in a new tab)
  28. Walmart Global Tech data engineering interview experienceLinkedIn, 2025 (opens in a new tab)
  29. Help with a Walmart data engineer interview (r/dataengineersindia)Reddit, 2025 (opens in a new tab)
  30. Why won’t they let you run your code? (r/datascience)Reddit, 2025 (opens in a new tab)
  31. Tools interviewers use to run SQL interviews (r/SQL)Reddit, 2025 (opens in a new tab)
  32. DE Shaw interview experience, Member Technical StaffLeetCode Discuss, 2025 (opens in a new tab)
  33. Zomato SDE intern interview, November 2024LeetCode Discuss, 2024 (opens in a new tab)
  34. CommerceIQ SDE-1 interview experienceMedium, 2025 (opens in a new tab)
  35. Swiggy ASDE online interviews, December 2024 (offer)interviewexperiences.in, 2025 (opens in a new tab)
  36. Infosys Specialist Programmer L2 interview experience (off campus)GeeksforGeeks (opens in a new tab)
  37. Cracking the Amazon Business Intelligence Engineer interviewMedium (opens in a new tab)
  38. Speaking in a SQL round: ask, check, then make it fastTradeoffRound (opens in a new tab)
  39. Amazon data engineer course: joins and aggregationDataInterview (opens in a new tab)
  40. Guidelines for virtual interviews at Google (candidate guide)Google (opens in a new tab)
  41. Hiring process FAQMeta Careers (opens in a new tab)
  42. Remote interviewAmazon Jobs (opens in a new tab)
  43. Amazon’s guidelines on AI use in job interviews (press report)Business Insider, 2025 (opens in a new tab)

Answer the query, then the follow-ups

Your first 30 minutes are free. After that it’s $5 an hour, pay as you go, with no subscription.

Start free — 30 minutes, no card
No credit card 30 minutes free Encrypted