I applied through Linkedin and got a follow up after a Month or so,
Round1 (DSA)
Q.1 Given a text/String , Return exactly K most frequent words.
Solved it using a Map and Priority Queue.
**Follow Up: **How would you handle the case where there are more than K words having maximum Frequency.
Sample Input -
text = "I am who I am"
K = 1
It was open ended, it was suggested in case of a tie, use a lexographical order.
Same could be accomadated in Priority Queue Comparator Logic.
Q.2 Stack Parantheses Question
Check if a given String is a valid Parantheses
Case 1 - https://leetcode.com/problems/valid-parentheses/description/
Extend the Solution for Case1 to return the length of the longest valid parantheses for the same string.
Overall the String could be invalid or valid, but we have to return the maximum length of any valid parantheses in a given String
Case 2- https://leetcode.com/problems/longest-valid-parentheses/description/
This round went well was invited for 2nd Round.
Round2 (Low Level Design)
Brief introductions.
Short discussions on the type of the projects I had done in my company and some details about it.
Why am I looking for a Job Change etc.
Question was around designing a Board Game.
Experience:
Gave the basic class design - Classes could be -
Game, Player, GameLoader, BoardGeneratorService, GameInteractionService
and some high level interfaces for same.
Was grilled on need for a GameInteractionService and what class should have it, initally had placed it in a wrong class, but by the end of the interview was able to correct it and all classes made sense and could interact with each other.
I was rejected in this round. Don't know the exact reason but maybe more was expected and took some more time to correct the placement and rationale of the GameInteraction Service.
I hope this helps someone applying or interviewing at Zynga. Cheers!