FastPrepIsomorphic Strings
Problems/Isomorphic Strings

Isomorphic Strings

Remitly logoRemitly● EasyFULLTIMEONSITE INTERVIEW

Updated Oct 2026

QuestionFunctionExamplesConstraints

Problem statement

Special thanks: A special thank you to our lovely, amazing frenz for sharing interview updates and helping keep this question up to date! 💐 ദ്ദി(˵ •̀ ᴗ - ˵ ) ✧

Given two strings s and t, determine whether they are isomorphic.

The strings are isomorphic when every character in s can be replaced consistently to produce t without changing character positions. Every occurrence of one character must map to the same character, and two different characters from s cannot map to the same character in t. A character may map to itself.

Function

isIsomorphic(s: String, t: String) → boolean

Examples

Example 1

s = "egg"t = "add"return = true

Map 'e' to 'a' and 'g' to 'd'. Applying those substitutions consistently produces t.

Example 2

s = "f11"t = "b23"return = false

The character '1' would need to map to both '2' and '3', so no consistent mapping exists.

Example 3

s = "paper"t = "title"return = true

The repeated-character pattern is identical in both strings, and each character has one distinct position-preserving mapping.

Constraints

  • 1 <= s.length <= 5 * 10^4
  • t.length == s.length
  • s and t contain valid ASCII characters.

More Remitly interview questions

  • Substitution Cipher Dictionary MatcherONSITE INTERVIEW · Seen Aug 2026
  • Rebalance Bank Accounts to a Minimum BalancePHONE SCREEN · Seen Sep 2026

Similar questions at other companies

  • Non-Repeating CharacterAutodesk · ONSITE INTERVIEWAutodesk interview questions
  • Container Ledger with TradesFlexport · ONSITE INTERVIEWFlexport interview questions
  • Count Adjacent Symbol Pairs for BPEAmazon · ONSITE INTERVIEW
  • Count a User's Actions in an Event LogMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Map and Accumulate Learning QueriesPalantir · ONSITE INTERVIEWPalantir interview questions
  • Filter Pins by Excluded IDsPinterest · ONSITE INTERVIEWPinterest interview questions
  • First Non-Repeating CharacterGoldman Sachs · PHONE SCREEN · ONSITE INTERVIEWGoldman Sachs interview questions
  • Longest Dictionary Word from Nine LettersGoogle · ONSITE INTERVIEWGoogle interview questions
  • Minimum Replacements to Make Two Strings AnagramsBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Logger Rate LimiterAmazon Web Services · ONSITE INTERVIEWAmazon Web Services interview questions
All Remitly interview questionsSee Remitly hiring insights
Saved
class Solution {
    public boolean isIsomorphic(String s, String t) {
      // Write your code here.
    }

}
Checking account…