Code Room
CodingMediumcod-g679
Subject Data wranglingLevel Mid–Senior~30 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

Implement an inner equi-join over two lists of records. `left` and `right` are lists of dicts. Join them where `left[key_l] == right[key_r]`. For each matching pair, produce a merged dict that contains all keys from the left record plus all keys from the right record EXCEPT `key_r` (to avoid an obvious duplicate of the join column); on any other key collision the right value wins. Preserve output order by left record order, then right record order. Return the list of merged dicts.

Implement
inner_join(left: list[dict], right: list[dict], key_l: str, key_r: str) → list[dict]
Examples
in[[{"id":1,"name":"a"}],[{"uid":1,"city":"ny"}],"id","uid"]out[{"id":1,"city":"ny","name":"a"}]
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.