Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

Inner Join

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

Inner join orders to users on user_id. Treat this as a production helper: match the contracted return shape, including empty and duplicate inputs.

Inner join orders to users on user_id. Select order_id, user_id, amount, name, email. Order by order_id. Assign result.

Constraints

  • how='inner'.
  • Order by order_id.

Examples

Input: orders + users Output: order_id | user_id | amount | name | email 101 | 1 | 50.0 | Ada | a@x.com 102 | 2 | 75.0 | Alan | b@x.com 103 | 3 | 20.0 | Grace | c@x.com 105 | 1 | 60.0 | Ada | a@x.com Order 104 has user_id 9 with no user row, so it drops.

Topics: lakebench, pyspark, inner.

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

beginner

Inner Join

Interview-style drill: Inner join orders to users on user_id.

Inner join `orders` to `users` on `user_id`. Select `order_id`, `user_id`, `amount`, `name`, `email`. Order by `order_id`. Assign `result`.