FastPrepWord Search
Problems/Word Search

Word Search

Microsoft logoMicrosoft● MediumINTERNONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Microsoft intern onsite interview. The report clearly names the well-known Word Search problem. We reused the function signature, examples, and limits from an equivalent reviewed version.

Our version is about 95% the same as the reported question.

Given a rectangular character grid board and a string word, return true if word can be formed by a path through the grid. Otherwise, return false.

A path may move horizontally or vertically between adjacent cells. The same grid cell cannot be used more than once in one path.

Function

wordExists(board: char[][], word: String) → boolean

Examples

Example 1

board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]]word = "ABCCED"return = true
board
01230ABCE1SFCS2ADEE

The path uses the top-row cells A, B, and C, then continues down to C, left to E, and left to D.

Example 2

board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]]word = "ABCB"return = false
board
01230ABCE1SFCS2ADEE

The only adjacent B that could finish the word is the cell already used after the starting A, and a cell cannot be reused.

Example 3

board = [["A"]]word = "A"return = true
board
00A

The single grid cell forms the complete word.

Constraints

  • 1 <= board.length <= 6
  • 1 <= board[i].length <= 6
  • Every row of board has the same length.
  • 1 <= word.length <= 15
  • board and word contain only uppercase and lowercase English letters.

More Microsoft Onsite Interview questions

  • 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
  • Totals from a Tiered Rate TableONSITE INTERVIEW · Seen Oct 2026

Similar questions at other companies

  • Word SearchBloomberg LP · OA · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Word SearchAmazon · ONSITE INTERVIEW
  • Enumerate Character Paths to a MarkerTesla · ONSITE INTERVIEWTesla interview questions
  • Trace a Word Through a Letter GridExpedia · ONSITE INTERVIEWExpedia interview questions
  • Find a Word in a Letter GridMeta · ONSITE INTERVIEWMeta interview questions
  • Enumerate Top-to-Bottom Grid PathsGoogle · ONSITE INTERVIEWGoogle interview questions
  • Word SearchCognitiv · PHONE SCREEN
  • Find a Word in a Letter GridAdobe · PHONE SCREENAdobe interview questions
  • Word SearchWhatNot · PHONE SCREENWhatNot interview questions
  • Rat in a Maze: All Simple PathsPeopleStrong · OAPeopleStrong interview questions

Interview reports that mention this question

  • Microsoft SWE Intern Interviews: 244 Experiences (Part 1 of 6)

Microsoft interview experiences

  • 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)
  • Microsoft SWE Intern, Late 2025: 47 Experiences (Part 3 of 6)
  • Microsoft SWE Intern, Early 2026: 54 Experiences (Part 2 of 6)
All Microsoft interview questionsSee Microsoft hiring insights
Saved
class Solution {
    public boolean wordExists(char[][] board, String word) {
      // Write your code here.
    }

}
Checking account…