SQL · PySpark · Debug the AI

Practice the data engineering problems that real pipelines throw at you

Duplicate rows, late-arriving data, slowly changing dimensions, joins that multiply rows. Each problem plants one of these traps in a small synthetic dataset and checks your answer without giving it away.

Browse all 40 problems Try one in the browser

Free. No sign-up. SQL problems run on this page; every problem runs in Google Colab.

practice problems
40
tracks: SQL, PySpark, Debug the AI
3
kinds of trap to practise
8
solvable right in the browser
19

How it works

From problem to explanation in four steps

  1. Pick a problem

    Filter by trap, track or difficulty. Every problem comes with a small dataset that has the awkward rows planted on purpose.

  2. Write your answer

    SQL problems have an editor on the page. Every problem also has a Google Colab notebook that installs PySpark and loads the data.

  3. Run the check

    It tells you what kind of thing is wrong (a missing column, the row count, which column) and never shows the answer.

  4. Read the explanation

    The approach, the common wrong answers and why each one fails, with the real numbers from the data.

Who it is for

Freshers and working engineers

NullTrap is for people in India preparing for data engineering interviews, and for engineers who want to get better at the work itself. The problems use small synthetic datasets with the awkward cases planted on purpose: nulls, ties, duplicates, late records.

The problems listed here are free. Harder problems with detailed explanations will be paid later.

About

Why it exists

NullTrap is built by Rishikesh Pandey, a data engineer who works with PySpark, Databricks and Delta Lake.

Most practice sites test whether you can write a query. In a real pipeline the query is rarely the hard part. The data is: the NULL in a lookup table, the payment that arrives twice, the event that shows up two days late.

It is a one-person side project. If something is wrong or unclear, open an issue on GitHub.

New

Latest problems

See all 40 problems

Debug the AIMedium

40. The load that never updates anything

AI-written PySpark code applies a batch of orders to a target table with a left anti join. New orders arrive, the row count is right, and every changed order keeps its old status. Find the bug and write the load properly.

Late-data trapDuplicate trapupsert · merge · incremental load · left anti join · deduplication

Debug the AIMedium

39. Seven rows are not seven days

AI-written PySpark code computes rolling 7-day revenue per store with rowsBetween(-6, 0). Stores that are closed on some days get a window that reaches back much further than a week. Find the frame bug and fix it.

Boundary trapwindow functions · rolling sum · rowsBetween · rangeBetween · missing days

Debug the AIMedium

38. The month that ends a day early

An AI-written Spark SQL query totals March payments per day with BETWEEN on a timestamp column. Every day is right except the last one. Find the date range bug and fix it.

Boundary trapbetween · timestamps · date range · half-open interval · month end