FastPrepFirst Dictionary Word Containing Target Letters
Problems/First Dictionary Word Containing Target Letters

First Dictionary Word Containing Target Letters

Atlassian logoAtlassian● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The source prose and sky example match at about 95%; they take precedence over the opposite unfinished attempt. Multiplicity, first-list selection, independent checks, empty no-match result and bounds are practice assumptions.

You are given a nonempty string target and an array words. Return the first word in words whose characters can form target. The word may have extra characters left over.

All characters are lowercase English letters. Build target by rearranging characters from one word only. Each character in that word can be used at most once. Do not join whole words together or mix letters from different words.

Check each word on its own. The first word means the one with the smallest index in words. If no word can form target, return the empty string. This includes the case where words is empty.

Function

firstContainingWord(target: String, words: String[]) → String

Examples

Example 1

target = "sky"words = ["cry","edt","srk","srrfkrey"]return = "srrfkrey"

cry has no s or k. edt has none of the letters. srk has no y. srrfkrey has s, k and y, and its extra letters are fine. So the answer is "srrfkrey".

Example 2

target = "aab"words = ["ab","bbaa","aaab"]return = "bbaa"

target needs two a letters and one b. ab has only one a. bbaa has two of each, which is enough. It comes first, so the answer is "bbaa".

Example 3

target = "abc"words = ["ab","bc"]return = ""

ab has no c, and bc has no a. No word can form target, so the answer is the empty string.

Constraints

  • 1 <= target.length <= 500
  • 0 <= words.length <= 200
  • 1 <= words[i].length <= 2000
  • All strings contain lowercase English letters.

More Atlassian Phone Screen questions

  • Merge Overlapping IntervalsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Tennis Court SchedulingPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Implement a Rate LimiterPHONE SCREEN · Seen Oct 2026
  • Longest Consistent Activity StreakPHONE SCREEN · Seen Sep 2026
  • Music Player Operation SequencePHONE SCREEN · Seen Sep 2026
  • Underline Shortest Unique SubstringsPHONE SCREEN · Seen Aug 2026
  • Can a Dictionary Word Be Formed from Note Letters?PHONE SCREEN · Seen Feb 2026
  • Word Path Moving Only Right or DownPHONE SCREEN · Seen Feb 2026
  • Ordered Badge Entry and Exit ViolationsPHONE SCREEN · Seen Aug 2025
  • Two Sum with an Ordered Index PairPHONE SCREEN · Seen Aug 2025

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

Atlassian interview experiences

  • Atlassian MLE Phone Screen: Model Deployment Design: 1 Experience
  • Atlassian Coding Screens and Karat: 3 Experiences (Part 2 of 2)
  • Atlassian Full Stack Interviews: 11 Experiences (Part 1 of 2)
All Atlassian interview questionsSee Atlassian hiring insights
Saved
class Solution {
    public String firstContainingWord(String target, String[] words) {
        // Write your code here.
        return "";
    }
}
Checking account…