Google Phone Screen rejected
Anonymous User
3020

I recently gave a phone screen interview at Google. The question was:

You have a set of logs from users (something like commit logs from users)

Message type <username> Message

e.g. Preamble <bob> code check in
	 Commit 2 <alice> change variables
	   ......

The goal is to find the top user by word count on the message. The structure is fixed: the name is encapsulated within brackets and then the messgae starts. A word is defined by a sequence of alphanumeric characters. Since it is picking the top user, I proposed a map based approach and parsing the message line using 2 pointers to get the user and word count. I did not feel heap would help since it is maximum. What is a good way to solve this apart from dictionary storage?

Comments (9)