FastPrepHow Many Sentences?
Problems/How Many Sentences?

How Many Sentences?

Atlassian logoAtlassian● MediumINTERNFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Atlassian online assessment for interns and full-time roles. Our version follows the whole prompt as shown in the report.

Words are anagrams when their characters can be rearranged to match. For each sentence, replace every word independently with any anagram present in wordSet. Return the number of sentences that can be formed.

Function

countSentences(wordSet: String[], sentences: String[]) → long[]

Examples

Example 1

wordSet = ["listen","silent","it","is"]sentences = ["listen it is silent"]return = [4]

Each occurrence of the listen/silent anagram group has two choices, so the product is four.

Constraints

  • 1 <= wordSet.length, sentences.length <= 1000
  • Inputs contain lowercase English words separated by single spaces.
  • Each answer fits in a signed 64-bit integer.

More Atlassian Online Assessment questions

  • Planning ProductionOA · Seen Feb 2025
  • K-Means ClusteringOA · Seen Feb 2025
  • Minimum Sorted Erasure OperationsOA · Seen Jun 2024
  • Count Analogous ArraysOA · Seen Mar 2024
  • Get Maximum ScoreOA · Seen Mar 2024
  • Better Compression 🦀OA · Seen Mar 2024
  • Romanizer 🐡OA · Seen Mar 2024
  • Flower Bouquets 💐OA · Seen Mar 2024
  • Binary Search Tree IteratorOA · Seen Nov 2023
  • Binary Tree Level Order TraversalOA · Seen Nov 2023

Similar questions at other companies

  • Count One-Swap Number PairsCapital One · OACapital One interview questions
  • How Many Sentences?Chubb · OAChubb interview questions
  • Perfect SubstringsVisa · OAVisa interview questions
  • Cheating CodemakerJane Street · OAJane Street interview questions
  • Count Equal-Frequency SubsequencesExpedia · OAExpedia interview questions
  • Count Phrases Formed by Anagram ReplacementWells Fargo · OAWells Fargo interview questions
  • Ransom NoteThe Walt Disney Company · OA · PHONE SCREENThe Walt Disney Company interview questions
  • Minimum Deletions to Make Every Letter Count EvenMarshall Wace · OAMarshall Wace interview questions
  • Apply Operations to Make a String EmptyFlexport · PHONE SCREENFlexport interview questions
  • Markov Transition Counts and ProbabilitiesRetool · ONSITE INTERVIEWRetool 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 long[] countSentences(String[] wordSet, String[] sentences) {
      // Write your code here.
    }

}
Checking account…