FastPrepCase-Insensitive Anagram Check
Problems/Case-Insensitive Anagram Check

Case-Insensitive Anagram Check

Upstart logoUpstart● EasyFULLTIMEOA
QuestionFunctionExamplesConstraints

Problem statement

Source note: The judged core task matches the visible interview report at about 100%.

Given two strings wordA and wordB, return true when they are anagrams of each other and false otherwise.

The comparison is case-insensitive. Anagrams must contain the same letters with the same multiplicities, but the letters may appear in any order.

Function

isAnagram(wordA: String, wordB: String) → boolean

Examples

Example 1

wordA = "Drier"wordB = "Rider"return = true

After ignoring case, both words contain one d, one e, one i, and two r letters.

Example 2

wordA = "hello"wordB = "world"return = false

The two words have different letter counts, so they are not anagrams.

Constraints

  • wordA and wordB are defined and may be empty.
  • Each string contains only uppercase and lowercase English letters.
  • 0 ≤ wordA.length, wordB.length ≤ 30.

More Upstart problems

  • Babysitter Quote with Hourly RatesONSITE INTERVIEW · Seen Oct 2026
  • Maximum SubarrayONSITE INTERVIEW · Seen Oct 2026
  • Buffet Day GainsOA · Seen Sep 2026
All Upstart interview questionsSee Upstart hiring insights
Saved
class Solution {
    public boolean isAnagram(String wordA, String wordB) {
        // write your code here
    }
}
Checking account…