Reported June 2024
Uberhash table

Word Pairs

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

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

Uber's Word Pairs question hit candidates in June 2024, and it's a straightforward string pattern problem that looks deceptively simple. You're given two words and need to figure out if they match some rule. The trick isn't in the algorithm, it's in spotting what rule the problem is actually testing. Most candidates overthink it or misread the pairing logic on first pass. StealthCoder can read the exact constraint and feed you the pattern in seconds if you blank during the live OA.

Pattern and pitfall

Word Pairs typically asks: given pairs of strings, determine if they follow a consistent one-to-one mapping. The classic version is checking if two words are isomorphic (like 'egg' and 'add': e-a, g-d, g-d). The gotcha is that the mapping must be bidirectional and consistent across all character pairs. You need a hash table to track the mapping from word1 to word2 and vice versa. If you ever see a character in word1 already mapped to a different character in word2, or the reverse, you fail. Edge cases: empty strings, single characters, repeated patterns. The pattern is hash-table logic with string indexing. If you freeze during the OA, StealthCoder will highlight the exact mapping constraint so you can code it without guessing.

StealthCoder is the hedge for the one pattern you didn't drill. It runs invisibly during the screen share.

If this hits your live OA

You can drill Word Pairs 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. If you're reading this with an OA window open, you're who this was built for.

Get StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as isomorphic strings. If you have time before the OA, drill that.

⏵ The honest play

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

Uber reuses patterns across OAs. If you're reading this with an OA window open, you're who this was built for. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Word Pairs FAQ

What does 'word pairs' actually mean here?+

You're checking if two strings follow a consistent character-to-character mapping. Each character in word1 maps to exactly one character in word2, and vice versa. If 'a' maps to 'x', it must always map to 'x'. Uber is testing whether you can spot and implement a bidirectional constraint.

Is this the same as checking if strings are isomorphic?+

Yes. Isomorphic strings are the canonical version of this problem. Uber calls it Word Pairs, but the logic is identical. You'll see it framed slightly differently in interviews, so recognizing the pattern matters more than the name.

What's the most common mistake?+

Implementing a one-way map (word1 to word2) without checking the reverse. If 'a' and 'b' both map to 'x', your code might not catch it. You need two hash tables or one map with validation both directions.

How do I solve this in under 5 minutes?+

Iterate through both words simultaneously. For each character pair, check if it's already in your mapping. If it is and doesn't match, return false. Track the reverse map too. Linear time, linear space. Hash table logic, no edge cases beyond length mismatch.

Do I need to handle weird inputs?+

Check length equality first (can't map if strings differ in length). Empty strings technically map to each other. Single characters always work. Focus on the core logic; Uber typically doesn't trick you with null or Unicode edge cases in OA.

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

OA at Uber?
Invisible during screen share
Get it