Left Join
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L4
Problem
Given two lists of dicts (left, right) and a shared key name, left-join the lists: for each left record, find the matching right record (the first one whose key matches) and merge its fields into the left record. If no right-side match exists, keep the left record as-is with no extra keys. Return the list.
Summary
Keep the left side. Match what you can.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.