Your question is Global Uniqueness Function. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Implement a 'global uniq' (deduplication) function/algorithm as a 90-minute onsite coding exercise.
Asked in the onsite stage. Candidate attempted an in-degree-tree-based approach, which they felt was not optimal; ultimately rejected.
Implement global_uniq(items). The input is a list of hashable values, and the output must contain each distinct value exactly once, ordered by its first appearance. Do not modify the input list.
def global_uniq(items):