Locale sort order differs upstream
Review this Python merge step that trusts each producer pre-sorted its display names, then validates before a sorted-merge join.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix, specific and kind.
0:00 of about 18 min
Mark a line and say what kind of problem it is.0 findings
1def merge_users(list_a, list_b):
2 # each list arrives 'sorted' from a separate upstream service
3 assert list_a == sorted(list_a), 'list_a not sorted'
4 assert list_b == sorted(list_b), 'list_b not sorted'
5
6 merged = []
7 i = j = 0
8 while i < len(list_a) and j < len(list_b):
9 if list_a[i] <= list_b[j]:
10 merged.append(list_a[i]); i += 1
11 else:
12 merged.append(list_b[j]); j += 1
13 merged.extend(list_a[i:]); merged.extend(list_b[j:])
14 return merged
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.
Run or narrate your approach, then ask the coach.