Google software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.
No verified questions yet for Google.
AutocompleteSystem that supports the following operations:input(char c: char) -> List[str]: Accepts a character and returns a list of the top 3 suggested terms that start with the current input string based on weighted frequency.addSentence(sentence: str, times: int) -> None: Adds a new sentence with its corresponding frequency.Example 1:1000.100 characters.get(key: int) -> int: Returns the value of the key if the key exists, otherwise return -1.put(key: int, value: int) -> None: Update the value of the key if the key exists. Otherwise, add the key-value pair to the cache. If the number of keys exceeds the capacity from this operation, the least recently used key should be removed.Example 1:10^4.Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free