Reported April 2026
Stripehash table

Merge and Filter Prioritized Configurations

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

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

Stripe reported this one in April 2026, and it looks friendlier than it is. Merge config tables by priority, then filter by selected keys. It's an array and hash map problem, but the strict parsing rules are where first attempts die. Leading zeros, plus signs, overflow past 32 bits, extra equals signs. Miss one and a hidden test fails. If you blank on the validation details during the live OA, StealthCoder is the safety net running invisibly on your screen. But the pattern is simple once you see it. One pass, one map, careful parsing.

The problem

You are given configuration tables and their integer priorities. Each table contains strings intended to have the form key=value, where a valid value is a signed 32-bit integer.
Merge the tables, then return only the requested keys.
Merge rules
A valid entry has an ASCII identifier key matching [A-Za-z_][A-Za-z0-9_]*.
A valid integer value is 0 or an optional minus sign followed by a nonzero ASCII digit and then zero or more ASCII digits. It must fit in a signed 32-bit integer. Leading zeros, a plus sign, an empty value, and extra = characters make an entry invalid.
Ignore every invalid entry without affecting other entries in the same table.
For each key, the valid value from the table with the greatest priority wins.
If two tables with that key have the same priority, the table appearing later in tables wins.
Each table contains at most one entry for any valid key.
Filter rules
Visit selectedKeys in its given order. For every selected key present in the merged configuration, append key=value to the result. Omit selected keys that have no valid merged value.
Process the tables in one pass; do not sort all configuration entries by priority.

Function
mergeAndFilterConfigurations(tables: String[][], priorities: int[], selectedKeys: String[]) → String[]

Examples
Example 1
tables = [["a=1","b=2"],["b=3","c=4"]]
priorities = [1,2]
selectedKeys = ["b","c"]
return = ["b=3","c=4"]
The second table has greater priority, so b=3 overrides b=2. The merged configuration is {a=1, b=3, c=4}; filtering in [b, c] order returns the shown result.
Example 2
tables = [["rate=10","timeout=bad"],["rate=7","timeout=30"],["rate=2147483648","extra=4"]]
priorities = [5,2,10]
selectedKeys = ["rate","timeout","extra"]
return = ["rate=10","timeout=30","extra=4"]
timeout=bad and the overflowing rate entry are invalid and skipped. The valid priority-5 rate=10 remains, while timeout=30 and extra=4 are retained.
Example 3
tables = [["a=1","b=2"],["a=8"],["b=9"]]
priorities = [3,3,2]
selectedKeys = ["a","b","missing"]
return = ["a=8","b=2"]
The later equal-priority table wins for a. The priority-3 value b=2 beats b=9 from priority 2, and missing is omitted.

Constraints
tables.length == priorities.length.
0 <= tables.length <= 100000.
The total number of entry strings across all tables is at most 200000.
Every entry string has length between 1 and 100.
Each table contains at most one entry for any valid key.
Every priority is a signed 32-bit integer.
0 <= selectedKeys.length <= 100000.
selectedKeys contains unique valid ASCII identifier keys.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick is a single pass with a hash map from key to a pair of (priority, value). For each table at index i, parse every entry. If it's valid, compare against the stored entry for that key. Replace when the new priority is greater, or equal, since the later table wins ties. Then loop selectedKeys in order and emit key=value for hits. The pitfall is validation. Split on the first equals and reject if a second one exists. Check the key against [A-Za-z_][A-Za-z0-9_]*. Reject leading zeros, plus signs, empty values, and a lone minus. Watch out for "-0", which fails the rule as written. Parse into a 64-bit integer and range check against -2^31 and 2^31-1. Don't sort by priority, the problem forbids it. StealthCoder is the hedge in the live OA if the edge cases slip, since it reads the rules and gives you a working parser.

If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.

If this hits your live OA

You can drill Merge and Filter Prioritized Configurations 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 StealthCoder

Related leaked OAs

⏵ The honest play

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

Stripe 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.

Merge and Filter Prioritized Configurations FAQ

What's the trick in the Stripe merge and filter configurations problem?+

Keep a hash map from key to the best (priority, value) seen so far. Process tables once, in order. Replace an entry when the new priority is greater or equal, since equal priority means the later table wins. Then walk selectedKeys and output hits.

Which edge cases fail most first attempts?+

Validation. Leading zeros like 007, a plus sign, an empty value, a second equals sign, and values past the signed 32-bit range. Also a key starting with a digit. Parse with a 64-bit type so overflow doesn't wrap before you check the range.

How hard is this really?+

Easy on algorithm, medium on care. The logic is a map and a comparison. The difficulty is the string rules. Write a separate isValidValue function and test it on 0, -5, -0, 05, +5, empty, and 2147483648 before you wire anything else.

Is -0 a valid value?+

By the stated rule, no. A valid integer is 0, or an optional minus followed by a nonzero digit and more digits. So -0 doesn't match and gets skipped. Zero alone is fine. Build your check to follow the rule text, not what a language parser accepts.

How do I prepare for this in 48 hours?+

Practice writing strict parsers by hand without library parse calls, since those accept plus signs and leading zeros. Rehearse the tie-break rule and the one-pass map update. Then run the three given examples plus your own invalid-entry cases. That covers what this OA tests.

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

OA at Stripe?
Invisible during screen share
Get it