Reported August 2026
Metabacktracking

Maximum Unique-Character Word Subset

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

Sixteen words max. That tiny constraint is the whole story of the Meta OA question reported in August 2026, Maximum Unique-Character Word Subset. Brute force over subsets is 2^16, about 65k combinations, so it's allowed. The trap is doing it sloppily with string concatenation and set checks inside every branch. The clean version uses a bitmask per word and DFS with include or skip. If you blank on the mask trick during the live OA, StealthCoder runs invisibly as a safety net and hands you the structure while you keep typing.

The problem

Given an array of lowercase English words, choose a subset whose concatenation contains no repeated character. Return the maximum possible length of such a concatenation.
A word that repeats a character inside itself cannot be selected. The order of selected words does not affect validity, and the empty subset is allowed. Return only the maximum length, not the selected subset.

Function
maxUniqueCharacterSubsetLength(words: String[]) → int

Examples
Example 1
words = ["un","iq","ue"]
return = 4
Selecting un and iq produces four distinct characters. Adding ue would repeat u.
Example 2
words = ["cha","r","act","ers"]
return = 6
Selecting cha and ers produces the six distinct characters in chaers.
Example 3
words = ["aa","bc"]
return = 2
The word aa is invalid because it repeats a internally. Selecting only bc gives length 2.

Constraints
0 <= words.length <= 16.
1 <= words[i].length <= 26.
Every word contains only lowercase English letters.

Reported by candidates. Source: FastPrep

Pattern and pitfall

Convert each word into a 26-bit integer where bit i is set if letter i appears. If a word has a repeated letter, its popcount won't equal its length, so drop it up front. Then run DFS over the remaining words with a running mask. At each index, you either skip the word or take it, but only if (mask & wordMask) == 0. Update the best length with the popcount of the mask, or track a running length. The common pitfall is forgetting to filter self-repeating words like "aa", which silently breaks the overlap check. Another is building strings and rebuilding sets on every call, which is slow and messy. Empty input must return 0. Since n is 16, no memoization is needed, though you can prune early. If the recursion feels shaky under pressure, StealthCoder is the hedge on the live OA: it reads the prompt and gives you a working bitmask DFS.

Drill it cold or hedge it with StealthCoder. Either way, don't walk into the OA hoping you remember the trick.

If this hits your live OA

You can drill Maximum Unique-Character Word Subset 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. Made for the candidate who got the OA invite this morning and has 72 hours, not six months.

Get StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as maximum length of a concatenated string with unique characters. If you have time before the OA, drill that.

⏵ The honest play

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

Meta reuses patterns across OAs. Made for the candidate who got the OA invite this morning and has 72 hours, not six months. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Maximum Unique-Character Word Subset FAQ

How hard is this Meta OA question really?+

Medium. The idea is simple once you see the constraint: 16 words means exploring every subset is fine. The difficulty is clean implementation. Bitmasks make the overlap check one operation, and the DFS is about ten lines. Most failures come from edge cases, not the algorithm.

What's the trick to solving it fast?+

Turn each word into a 26-bit mask and discard words with duplicate letters. Then DFS with include or skip, only including a word when its mask shares no bits with the current mask. Track the max popcount or length. That's the full solution.

Do I need dynamic programming or memoization?+

No. With at most 16 words, plain backtracking over 2^16 subsets is fast enough. Memoization adds complexity without a real payoff here. Spend your time on the mask logic and the self-duplicate filter instead.

What edge cases break most solutions?+

Words with internal repeats like "aa" must be excluded. An empty array should return 0. Also remember the empty subset is valid, so the answer is never negative. Check that skipping a word is always an option in your DFS, not just taking it.

How do I prepare in 48 hours?+

Write this once from scratch with bitmasks and DFS, then rewrite it iteratively over masks of subsets if you have time. Practice precomputing word masks and the overlap check. Then do two or three other include-or-skip backtracking problems so the pattern feels automatic.

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