parseLog(String filepath) { // Implemented for you } Parse each line, extract username and message, count words, aggregate per user in a map, sort by total word count (desc), return top N. Given a chat log, count how many words each user has spoken and return the top N most talkative users. Key steps: Parse each log line to extract the username. Split the message to count the number of words. Accumulate counts in a HashMap. Sort users by total word count (descending) and return the top N. The VOprep team has long accompanied candidates through various major company OAs and..."/> Google Interview Problem #8 — Top Talkative Users – interview proxy – VO help – onsite support - VO Prep

Google Interview Problem #8 — Top Talkative Users – interview proxy – VO help – onsite support

Given a log file, find the top N most talkative users

10:00 <john> hi!
10:01 <maria> hello!
10:07 <john> can you link the design?
// Returns e.g.
// [
//   {username: "john", wordCount: 1},
//   {username: "maria", wordCount: 1},
//   {username: "john", wordCount: 5}
// ]
public List<UserWordCount> parseLog(String filepath) {// Implemented for you}

Parse each line, extract username and message, count words, aggregate per user in a map, sort by total word count (desc), return top N.

Given a chat log, count how many words each user has spoken and return the top N most talkative users.

Key steps:

  1. Parse each log line to extract the username.
  2. Split the message to count the number of words.
  3. Accumulate counts in a HashMap.
  4. Sort users by total word count (descending) and return the top N.

The VOprep team has long accompanied candidates through various major company OAs and VOs, including OpenAI, Google, Amazon, Citadel, SIG, providing real-time voice assistance, remote practice, and interview pacing reminders to help you stay smooth during critical moments. If you are preparing for Stripe or similar engineering-focused companies, you can check out our customized support plans—from coding interviews to system design, we offer full guidance to help you succeed.

END
 0