Find Unique Values
Reported by candidates from Amazon's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Amazon's January 2024 OA included a deceptively simple problem: find the unique values in a dataset. On the surface it sounds like a hash table drill, but the real question is execution under pressure. You'll see a list with duplicates and need to isolate what appears once. The trick isn't the algorithm. It's handling the edge cases fast enough that you don't second-guess yourself. StealthCoder sits ready if you blank on syntax or start overthinking the approach.
Pattern and pitfall
This problem tests whether you can quickly choose between a set-based approach and a hash map counter. Most candidates jump to creating a set and iterating, which works. The pitfall is not thinking about order: does Amazon want the unique values in input order, sorted, or any order. The counting approach (hash map with frequency 1) scales better for very large datasets with few duplicates, but it's slightly slower to code. The pattern here is hash-table logic dressed up as a "find" problem. StealthCoder's real value is catching the edge case you'd miss under time pressure, like empty input or all duplicates.
If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.
You can drill Find Unique Values cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it.
Get StealthCoderRelated leaked OAs
This OA pattern shows up on LeetCode as contains duplicate. If you have time before the OA, drill that.
You've seen the question.
Make sure you actually pass Amazon's OA.
Amazon reuses patterns across OAs. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Find Unique Values FAQ
Does order matter for the output?+
Almost always. Amazon typically wants unique values in the order they first appear unless explicitly stated otherwise. Test your solution against the examples carefully. If the problem doesn't specify, ask or assume insertion order. Don't default to sorted unless the problem screams it.
Is this really just a set problem?+
Functionally yes, but Amazon variants sometimes ask for count or position of uniques, not just the values themselves. Read the exact output requirement. A simple set() works for the pure version, but be ready to pivot to a hash map if they want frequency data.
What's the real pitfall here?+
Overthinking it. Candidates often assume Amazon wants some complex deduplication logic when it's just a filter operation. Code the hash table approach, test it, move on. Don't waste time optimizing unless the input size suggests you need to.
Can I use a set in Python and call it done?+
Yes, if the problem only asks for unique values. But sets don't preserve insertion order in older Python versions, so check. If order matters, use dict.fromkeys() or a hash map with a separate list to track order. Test before submitting.
How do I prepare for this in 48 hours?+
You don't need to. Know how to code a set, a hash map, and a filter loop in your language. Run through one duplicate-removal problem. That's it. Amazon's January version is a speed and clarity test, not a hard algorithmic problem. Focus on clean code, not tricks.