FastPrepFirst Dictionary Word from Note Letters
Problems/First Dictionary Word from Note Letters

First Dictionary Word from Note Letters

Indeed logoIndeed● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The first-constructible-word objective and balloons/son example match the source at about 95%; alphabet, occurrence-use details, bounds and the no-match result are defined for this exercise.

Given a string note and an ordered array words, return the first word that can be formed by rearranging letters from note. The first word means the one with the smallest index in the input array.

For this exercise, assume all characters are lowercase English letters, every word is nonempty, and each character occurrence in note may be used at most once to form a candidate word. Candidates are checked independently, so testing one word does not consume letters for later words.

For this exercise, assume an empty string is returned if no word can be formed. The note and the dictionary may be empty.

Function

firstWord(note: String, words: String[]) → String

Examples

Example 1

note = "balloons"words = ["son","ball","friends"]return = "son"

The answer is son because it is the first constructible dictionary word; later ball is also constructible.

Example 2

note = "aab"words = ["baa","aaa","ab"]return = "baa"

Reordering is allowed and each character occurrence is used at most once; baa is first.

Constraints

  • For this exercise, assume 0 <= note.length <= 10^4.
  • 0 <= words.length <= 1000.
  • Each word length is from 1 through 1000.
  • All characters are from a through z.

More Indeed Phone Screen questions

  • Insert into an Unrolled Linked ListPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Course Completion OrderPHONE SCREEN · Seen May 2025
  • Recipes You Can PreparePHONE SCREEN · Seen May 2025
  • Rotting Orange PropagationPHONE SCREEN · Seen May 2025
  • Courses Shared by Every Student PairPHONE SCREEN · Seen Aug 2022
  • First and Last Access Time per UserPHONE SCREEN · Seen Jul 2022
  • Most Accessed Resource in Five MinutesPHONE SCREEN · Seen Jul 2022
  • Resource Transition GraphPHONE SCREEN · Seen Jul 2022
  • Count Disappearing Connected TilesPHONE SCREEN · Seen Jul 2022
  • Word Path Moving Only Right or DownPHONE SCREEN · Seen Jul 2022

Similar questions at other companies

  • Transaction Fee Calculator — Parts 1–2: Basic Fee Calculation and Conditional Fee RulesStripe · PHONE SCREENStripe interview questions
  • Detect a Straight FlushTemu · PHONE SCREENTemu interview questions
  • First Letter to Appear TwiceCisco · PHONE SCREENCisco interview questions
  • Halfway Course in a Single TrackCrunchyroll · PHONE SCREENCrunchyroll interview questions
  • Single-Condition Product FilterCrowdstrike · PHONE SCREENCrowdstrike interview questions
  • Summarize Server Healthcheck LogsNVIDIA · PHONE SCREENNVIDIA interview questions
  • Known Words Matching Phone DigitsLinkedIn · PHONE SCREENLinkedIn interview questions
  • First Non-Repeated CharacterDell Technologies · PHONE SCREENDell Technologies interview questions
  • Convert an Entry List to a MapEPAM · PHONE SCREENEPAM interview questions
  • First Non-Repeating CharacterGoldman Sachs · PHONE SCREEN · ONSITE INTERVIEWGoldman Sachs interview questions

Indeed interview experiences

  • Indeed Experienced SWE Karat Screens and OAs: 6 Experiences
  • Indeed SWE Intern Karat Screens and OA: 3 Experiences
  • Indeed New Grad SWE Online Assessments: 3 Experiences
All Indeed interview questionsSee Indeed hiring insights
Saved
class Solution {
    public String firstWord(String note, String[] words) {
        // Write your code here.
        return "";
    }
}
Checking account…