Most Frequent Word across Grouped Arrays
Updated
Problem statement
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[][]) → StringExamples
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