Reported September 2026
Metahash table

Values Exclusive to the Current User

Reported by candidates from Meta's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Meta OA. Under 2s to a working solution.
Founder's read

The Meta OA reported in September 2026 looks like a string problem, but it's really a set problem. You get a grid of values per user, and you need the ones only the current user owns, sorted. If you've got an assessment in the next day or two, this is a good one to see, because the hash set does almost all the work. StealthCoder sits invisibly on your screen as a safety net if you blank on the setup. The logic is short, the edge cases are friendly, and the constraints let a plain approach pass.

The problem

userValues[i] contains the string values stored for user i. Values may repeat within a user's row.
Return the distinct values owned by currentUser that appear in no other user's row. Return them in ascending lexicographic order.

Function
exclusiveValues(userValues: String[][], currentUser: int) → String[]

Examples
Example 1
userValues = [["red","blue"],["blue","green"],["yellow"]]
currentUser = 0
return = ["red"]
Blue is shared, while red belongs only to user 0.
Example 2
userValues = [["a","a","b"],["c"]]
currentUser = 0
return = ["a","b"]
Duplicates within the current user's row do not remove exclusivity or duplicate output.
Example 3
userValues = [["x"],["x"],["x"]]
currentUser = 1
return = []
The only value is shared by every user.

Constraints
1 <= userValues.length <= 30.
0 <= currentUser < userValues.length.
Across all rows there are at most 10^5 values.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The data structure is a hash set. Build a set from the current user's row, which handles duplicates for free. Then loop over every other user's row and remove each value from that set. Whatever survives is exclusive. Sort it ascending and return. That's O(n) for the scan plus O(k log k) for the sort, with n capped at 10^5 values. The common pitfall is counting values across all users and checking for a count of 1. That breaks on Example 2, where 'a' appears twice in the current user's own row. Another slip is skipping the index check and subtracting the current row from itself, which empties your set. Skip i equal to currentUser. Use default string sorting for lexicographic order. If you freeze during the live OA, StealthCoder can hand you this set-difference solution so you can type it out and move on.

The honest play: practice the pattern, and have StealthCoder ready for the one you didn't see coming.

If this hits your live OA

You can drill Values Exclusive to the Current User 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 for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Meta's OA.

Meta reuses patterns across OAs. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Values Exclusive to the Current User FAQ

How hard is the Meta exclusive values question really?+

Easy. It's a set difference plus a sort. The only thinking is handling duplicates inside the current user's row and not subtracting that row from itself. If you know hash sets, you finish this quickly and spend your remaining time on the harder questions.

What's the trick to solving it?+

Put the current user's values in a set, then delete every value found in any other user's row. What's left is exclusive. Sort it at the end. The set removes duplicates automatically, so you never need extra dedupe logic.

Why does counting occurrences across all rows fail?+

A value repeated inside the current user's own row gets a count above 1 even though no one else has it. Example 2 shows this with 'a'. You'd have to count per user, not per value. The set difference avoids the whole problem.

What's the time complexity I should state?+

Linear in total values to build and subtract the sets, plus k log k to sort the k surviving values. With at most 10^5 values across all rows, this is comfortably fast. Mention the set lookups are average O(1).

How do I prepare for this in 48 hours?+

Practice set difference and set intersection problems in your chosen language, and know how its default string sort orders values. Then write this one from scratch twice. Check the edge cases: a single user, an empty result, and duplicates within one row.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Meta.

OA at Meta?
Invisible during screen share
Get it