Code Room
CodingMediumcod-g1216
Subject Data wranglingLevel Entry–Mid~13 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

Before importing a sales backup, you must check referential integrity. `orders` rows look like "order_id,customer_id" (order ids are distinct); `customers` rows look like "customer_id,name". An order is an orphan when its customer_id matches no customer row. Return the orphan order ids sorted ascending (plain string order). Example: orders ["o1,c1", "o2,c9", "o3,c2"] with customers ["c1,ava", "c2,raj"] give ["o2"].

Implement
orphan_orders(orders: list[str], customers: list[str]) → list[str]
Examples
in[["o1,c1","o2,c9","o3,c2"],["c1,ava","c2,raj"]]out["o2"]
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.