FastPrepMost Frequent Word across Grouped Arrays
Problems/Most Frequent Word across Grouped Arrays

Most Frequent Word across Grouped Arrays

ZipRecruiter logoZipRecruiter● EasyNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A ZipRecruiter new-grad phone-screen report describes arrays of words as dictionary values and returning the most frequent word across them. Dictionary keys do not matter for the count. We supplied the tie-break, case sensitivity, empty input, the input as grouped arrays, and limits. Our version is about 81% the same as the reported question.

Count every word occurrence across all rows of groups. Return the word with highest frequency, breaking ties lexicographically. Matching is case-sensitive. Return an empty string when there are no words.

Function

mostFrequentWord(groups: String[][]) → String

Examples

Example 1

groups = [["a","b"],["a","c"]]return = "a"

Word a occurs twice across rows.

Example 2

groups = [["beta"],["alpha"]]return = "alpha"

Lexicographic order resolves equal frequency.

Constraints

  • 0 <= groups.length <= 10000
  • The total number of words is at most 100000.

More ZipRecruiter Phone Screen questions

  • Neighboring Record IDsPHONE SCREEN · Seen May 2026
  • Restaurant Vote LeadersPHONE SCREEN · ONSITE INTERVIEW · Seen Feb 2026
  • Starting Value with the Longest Collatz ChainPHONE SCREEN · Seen Apr 2022
  • Classify an Alien Dictionary OrderingPHONE SCREEN · ONSITE INTERVIEW · Seen Mar 2022
  • Multiset Intersection of Three ListsPHONE SCREEN · Seen Feb 2022
  • Find the Smallest Magic IndexPHONE SCREEN · Seen Dec 2021
  • Website Pair with the Most Common VisitorsPHONE SCREEN · Seen Nov 2021
  • Center-Outward Number SpiralPHONE SCREEN · Seen Jun 2021
  • Missing Ranges within Inclusive BoundsPHONE SCREEN · Seen Feb 2021
  • Fibonacci Number with Constant Extra SpacePHONE SCREEN · Seen Mar 2017

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

ZipRecruiter interview experiences

  • ZipRecruiter SWE OA, Level Not Reported: 23 Experiences
  • ZipRecruiter SWE Intern OA Scores: 4 Experiences
  • ZipRecruiter SWE New Grad OA: 9 Experiences
All ZipRecruiter interview questionsSee ZipRecruiter hiring insights
Saved
class Solution {
    public String mostFrequentWord(String[][] groups) {
        // Write your code here.
    }

}
Checking account…