Google | Phone Interview
Anonymous User
7862

I had a phone interview with Google recently
Question:
Given the user and there posts, maximize the likes of N posts where N appears atleast N times.
For eg. Consider likes = [8,6,5,5,2,1] Output: 4 (Because there are 4 post with 4 likes. )
Explaination: 8 contains 4 likes, 6 contains 4 likes,5 contains 4 likes,5 contains 4 likes and more importantly number of posts are 4

  1. likes = [1,2,2] Output 2 (Because there are 2 post with 2 likes)
  2. likes = [1,3,4,2] Output 2(Because there are 2 post with 2 likes)

Edit:
Few important tips: I worked really hard for this interview. I practiced Google leetcode explore card problems and tagged problems.I did mock round practice to complete code in 45 mins. I was pretty confident and well prepared.
On the day of phone interview, my interviewer was passively engaged. He gave me tough time to explain the problem well. It took me nearly 20 minutes to understand this problem. I could just reach the solution but couldnt complete the code properly. (You might not believe this)I also got internet problems for 2-3 times during the interview. Though everything was working fine when i checked it 1 hour before.
So, I just want to alert the candidates who are preparing that sometimes its just not your day.Even though you have prepared well, external circumstances might mess up your things. But, its important to keep your confidence high and stand there till the end. Keep working hard and keep trying. Best Luck!

Comments (20)