Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

Left Join

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

Left join orders to users so unmatched orders remain. Treat this as a production helper: match the contracted return shape, including empty and duplicate inputs.

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

Constraints

  • Keep all orders.

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 104 | 9 | 40.0 | None | None 105 | 1 | 60.0 | Ada | a@x.com Order 104 survives with null name/email.

Topics: lakebench, pyspark, left.

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

beginner

Left Join

Interview-style drill: Left join orders to users so unmatched orders remain.

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