Implement Left Join Using Python Dictionaries Efficiently
Company: Citadel
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: Medium
Interview Round: Technical Screen
Orders
+---------+----------+--------+
| order_id| customer | amount |
+---------+----------+--------+
| 101 | C1 | 250 |
| 102 | C2 | 300 |
| 103 | C3 | 150 |
Customers
+----------+-----------+
| customer | city |
+----------+-----------+
| C1 | Seattle |
| C3 | Boston |
| C4 | Austin |
##### Scenario
Performing a left join in pure Python without external libraries.
##### Question
Write Python code (no third-party packages) to left-join two lists of dictionaries on key "customer"; discuss an O(N+M) hashing solution.
##### Hints
Contrast nested loops with dict-based look-ups; handle missing matches gracefully.
Quick Answer: This question evaluates competency in tabular data manipulation and join semantics using Python dictionaries, emphasizing understanding of hashing-based lookups and algorithmic complexity such as O(N+M).