Number-Character Bijective Mapping
Reported by candidates from Adobe's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Adobe reported this one in August 2026, and the detail that matters is in the constraints: pattern can be 10^5 long, but the total length of all passcodes is capped at 2 * 10^5. That cap tells you what the grader expects. It's an isomorphic-strings check run once per passcode, with integers on one side and characters on the other. If you've seen word pattern or isomorphic strings, you've seen this. If you blank on the night, StealthCoder sits invisibly on your screen as a safety net during the live OA. The trick is small. The traps are all in the edge cases.
The problem
Given an integer array pattern and an array of candidate strings passcodes, test each passcode independently. A passcode is valid when it has the same length as pattern and the positions define a bijection between integer values and characters: Every occurrence of the same integer maps to the same character. Two different integers never map to the same character. Return a boolean array in query order, where each value states whether the corresponding passcode is valid. Function checkBijectiveMappings(pattern: int[], passcodes: String[]) → boolean[] Examples Example 1 pattern = [1, 2, 1] passcodes = ["aba","abc","xyx","x"] return = [true, false, true, false] aba and xyx preserve the repeated first value. In abc, value 1 maps to two characters, and x has the wrong length. Example 2 pattern = [7, 7, 8] passcodes = ["aab","abb","aac"] return = [true, false, true] aab and aac assign one character to value 7 and a different character to value 8. In abb, the repeated value 7 maps inconsistently. Constraints 1 <= pattern.length <= 10^5 -10^9 <= pattern[i] <= 10^9 1 <= passcodes.length <= 10^5 0 <= passcodes[i].length sum of all passcode lengths <= 2 * 10^5 Every passcode contains only ASCII letters or digits.
Reported by candidates. Source: FastPrep
Pattern and pitfall
Use two hash maps per passcode: integer to char, and char to integer. Walk the positions. If the lengths differ, return false right away, and skip the map work. At each index, check that the integer's existing mapping equals the current char, and that the char's existing mapping equals the current integer. Any mismatch means false. Checking only one direction is the classic bug. In Example 2, abb fails because 7 maps to both a and b, but a one-way check on the wrong side would let a case like pattern [1,2] with passcode aa slip through. Here's the real pitfall: pattern can be 10^5 long, and you have up to 10^5 passcodes. Don't rebuild anything proportional to pattern length before the length check, or you'll blow the time budget. Check length first, then the work is bounded by the total passcode length. If you freeze during the live OA, StealthCoder can hand you the two-map structure so you can just type it.
Drill it cold or hedge it with StealthCoder. Either way, don't walk into the OA hoping you remember the trick.
You can drill Number-Character Bijective Mapping 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 StealthCoderRelated leaked OAs
This OA pattern shows up on LeetCode as isomorphic strings. If you have time before the OA, drill that.
You've seen the question.
Make sure you actually pass Adobe's OA.
Adobe 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.
Number-Character Bijective Mapping FAQ
What's the trick in the Adobe number-character bijection problem?+
Track the mapping in both directions. One map goes from integer to character, the other from character to integer. A single map catches repeated values mapping inconsistently, but it misses two different integers sharing one character. You need both to enforce a true bijection.
How hard is this really?+
Easy to medium. It's the isomorphic strings pattern applied to a list of queries. The logic is about ten lines. Most failures come from forgetting the reverse map or forgetting to check length first, not from the algorithm itself.
What's the time complexity I should aim for?+
Linear in the total passcode length. Check each passcode's length against pattern first and skip mismatches immediately. Only passcodes of matching length get scanned, so total work stays bounded by the 2 * 10^5 sum of lengths. Each hash map operation is O(1) on average.
Which edge cases should I test before submitting?+
Test a passcode with the wrong length, including an empty string. Test pattern values that are negative or huge, up to 10^9. Test two different integers mapping to the same character, like [1,2] with aa. Test a single-element pattern. Make sure maps reset for each passcode, not shared.
How do I prepare for this in 48 hours?+
Write isomorphic strings and word pattern from scratch until the two-map approach is automatic. Then adapt it to an integer array on one side. Practice returning a boolean array across many queries. That's enough, since this problem is a thin variation on a well-known pattern.