Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

Anti-Join

PySpark data engineering interview problem. Difficulty: beginner. Pattern: Joins. About 12 minutes. Part of the Pro drill bank.

Find orders whose user_id is missing from users. Treat this as a production helper: match the contracted return shape, including empty and duplicate inputs.

Return orders with no matching users.user_id using a left anti join. Select order_id, user_id, amount. Order by order_id. Assign result.

Constraints

  • Use left_anti (or anti).
  • Output three order columns.

Examples

Input: orders + users Output: order_id | user_id | amount 104 | 9 | 40.0 Only user_id 9 is absent from users.

Topics: lakebench, pyspark, left_anti.

More PySpark interview questions · All interview problems · Learn data engineering

beginner

Anti-Join

Interview-style drill: Find orders whose user_id is missing from users.

Return orders with no matching `users.user_id` using a left anti join. Select `order_id`, `user_id`, `amount`. Order by `order_id`. Assign `result`.