FastPrepCheck If Two String Arrays Are Equivalent
Problems/Check If Two String Arrays Are Equivalent

Check If Two String Arrays Are Equivalent

Microsoft logoMicrosoft● EasyFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report from a Microsoft Data & Applied Science internship names a well-known problem and includes the example with the Microsoft fragments. We chose the function signature and the limits. Our version is about 99% the same as the reported question.

You are given two arrays of non-empty string fragments, word1 and word2.

Concatenate the fragments in each array in order. Return true when the two resulting strings are exactly equal, and return false otherwise.

Comparison is case-sensitive.

Function

arrayStringsAreEqual(word1: String[], word2: String[]) → boolean

Examples

Example 1

word1 = ["Mic","ro","soft"]word2 = ["M","ic","roso","ft"]return = true

Both arrays concatenate to Microsoft.

Example 2

word1 = ["ab","c"]word2 = ["a","bc"]return = true

The fragment boundaries differ, but both arrays form abc.

Example 3

word1 = ["a","cb"]word2 = ["ab","c"]return = false

The arrays form acb and abc, which differ.

Constraints

  • 1 <= word1.length, word2.length <= 1000
  • Every fragment contains from 1 through 1000 letters.
  • The total number of characters in each array is at most 100000.
  • Comparison is case-sensitive.

More Microsoft Onsite Interview questions

  • Bad Request AlertsONSITE INTERVIEW · Seen Nov 2026
  • Longest Substring Without Repeating CharactersONSITE INTERVIEW · Seen Nov 2026
  • Valid ParenthesesONSITE INTERVIEW · Seen Nov 2026
  • Count a User's Actions in an Event LogONSITE INTERVIEW · Seen Nov 2026
  • Smallest Batch Size Within a Step LimitONSITE INTERVIEW · Seen Nov 2026
  • Count Subarrays with Equal Even and Odd CountsONSITE INTERVIEW · Seen Nov 2026
  • Minimum Time to Rot All OrangesONSITE INTERVIEW · Seen Nov 2026
  • Coin ChangeONSITE INTERVIEW · Seen Oct 2026
  • Daily USD Totals with Effective-Dated Exchange RatesONSITE INTERVIEW · Seen Oct 2026
  • Number Words to Digits in Any LanguageONSITE INTERVIEW · Seen Oct 2026

Similar questions at other companies

  • Reverse the Interior of Vowel-Bounded WordsVisa · OAVisa interview questions
  • Reverse the Interior of Vowel-Bounded WordsZipRecruiter · OAZipRecruiter interview questions
  • Add Signed Character ArraysByteDance · PHONE SCREENByteDance interview questions
  • Objects Seen on Both Days by Multiple ClientsGoogle · PHONE SCREENGoogle interview questions
  • Longest Common PrefixKotak Mahindra Bank · PHONE SCREEN · ONSITE INTERVIEWKotak Mahindra Bank interview questions
  • Longest Spoken PrefixElevenLabs · ONSITE INTERVIEWElevenLabs interview questions
  • Palindrome Check Ignoring SymbolsWalmart · ONSITE INTERVIEWWalmart interview questions
  • Reverse a String Keeping Dashes in PlaceNykaa · ONSITE INTERVIEWNykaa interview questions
  • Merge Sorted ArrayDP World · ONSITE INTERVIEW
  • Map and Accumulate Learning QueriesPalantir · ONSITE INTERVIEWPalantir interview questions

Interview reports that mention this question

  • Microsoft AI/ML Intern Interviews: 114 Experiences (Part 1 of 2)

Microsoft interview experiences

  • Microsoft OA Questions, October 2026: 4 Experiences
  • Microsoft Experienced SWE Phone Screen: 1 Experience
  • Microsoft Explore and Student SWE: 12 Experiences (Part 6 of 6)
  • Microsoft SWE Intern, Early 2025: 41 Experiences (Part 5 of 6)
  • Microsoft SWE Intern, Mid 2025: 42 Experiences (Part 4 of 6)
All Microsoft interview questionsSee Microsoft hiring insights
Saved
class Solution {
    public boolean arrayStringsAreEqual(String[] word1, String[] word2) {
        // Write your code here.
    }
}
Checking account…