FastPrepCan the Text Split Into Dictionary Words
Problems/Can the Text Split Into Dictionary Words

Can the Text Split Into Dictionary Words

Adobe logoAdobe● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The task: can dictionary words, joined end to end, rebuild a given text?

This comes from a February 2022 report. The candidate got an MTS-2 offer in Noida as an SDE1 with two years of experience. The first technical round lasted one hour. It had language and object-oriented design questions plus two coding items. This was the second one. The first was about counting how often one value repeats in a sorted array.

The report states the task in one line. It leaves out limits, whether a word can be reused, examples and the output form.

We chose these rules: a word can be used any number of times, and the answer is true or false. Only lower-case letters appear. The string has 1 to 1000 letters. There are 1 to 500 different words, each 1 to 20 letters. The examples are new.

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

You are given a string s and a list of words wordDict. Return true if s can be cut into pieces so that every piece is a word from wordDict, and false otherwise.

The pieces must cover s exactly, in order, with no letters left over and no overlap. A word may be used any number of times, and some words may not be used at all.

Function

canSplit(s: String, wordDict: String[]) → boolean

Examples

Example 1

s = "redredwood"wordDict = ["red","wood","redw"]return = true

Split it as red + red + wood. The same word may be used more than once, so the answer is true.

Example 2

s = "pinetrees"wordDict = ["pin","pine","etree","tree"]return = false

pine + tree leaves s, and pin + etree also leaves s. No word is s or ends with it, so no split works: false.

Example 3

s = "sunflowerpot"wordDict = ["sunflow","sun","flower","pot"]return = true

Taking the longest word first, sunflow, leaves erpot, which cannot be split. But sun + flower + pot works, so the answer is true.

Constraints

  • 1 <= s.length <= 1000
  • 1 <= wordDict.length <= 500
  • 1 <= wordDict[i].length <= 20
  • s and every wordDict[i] consist of lower-case English letters.
  • All words in wordDict are different.

More Adobe Phone Screen questions

  • Evaluate a Parenthesized Integer ExpressionPHONE SCREEN · Seen Oct 2026
  • All Elements of Two BSTs in OrderPHONE SCREEN · Seen Aug 2026
  • Rotate an Array In PlaceOA · PHONE SCREEN · Seen Aug 2026
  • Binary Tree Level-Order Traversal by LevelsPHONE SCREEN · ONSITE INTERVIEW · Seen Aug 2026
  • Count Occurrences in a Sorted ArrayPHONE SCREEN · ONSITE INTERVIEW · Seen Jul 2026
  • Count Pairs with Absolute Difference KPHONE SCREEN · Seen Jul 2026
  • Count Subsets with Sum KPHONE SCREEN · Seen Jul 2026
  • Numbers with Exactly Three DivisorsPHONE SCREEN · Seen Jul 2026
  • Sum of Even Nodes on a Path in a Numbered Binary TreePHONE SCREEN · Seen Jul 2026
  • Largest Value in Every Sliding WindowPHONE SCREEN · Seen Jul 2026

Similar questions at other companies

  • Word BreakAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Minimum Dictionary SegmentsGoogle · PHONE SCREENGoogle interview questions
  • Word BreakBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Longest Common URL History RunDatadog · PHONE SCREENDatadog interview questions
  • Word Break IIWex · PHONE SCREEN
  • Indexed Proximity SearchStripe · PHONE SCREENStripe interview questions
  • Word BreakMoveworks · ONSITE INTERVIEWMoveworks interview questions
  • Longest String ChainVisa · OAVisa interview questions
  • Word Break with a Reusable DictionaryMeta · ONSITE INTERVIEWMeta interview questions
  • Count Equal-Frequency SubsequencesExpedia · OAExpedia interview questions

Interview reports that mention this question

  • Adobe MTS Interview Questions: 12 Experiences (Part 2 of 6)

Adobe interview experiences

  • Adobe Web, QA, DevOps, ML Roles: 13 Experiences (Part 3 of 3)
  • Adobe SWE Interviews, Level Unknown: 25 Experiences (Part 2 of 3)
  • Adobe Interviews, Level Unknown: 38 Experiences (Part 1 of 3)
  • Adobe New Grad MTS Interview Questions: 7 Experiences
  • Adobe ML/Research Intern Interviews: 12 Experiences (Part 4 of 4)
All Adobe interview questionsSee Adobe hiring insights
Saved
class Solution {
    public boolean canSplit(String s, String[] wordDict) {
        // Write your code here.
    }
}
Checking account…