Return Words Matching a Typed Prefix
GoogleSoftware Engineer · OnsiteLast updated
Practice a Google coding interview problem focused on return words matching a typed prefix. The prompt emphasizes edge cases, clean implementation, and verifiable test behavior without revealing the solution.
Given words and a query prefix, return all words starting with that prefix in lexicographic order.
Implement:
def prefix_matches(words: list[str], prefix: str) -> list[str]:
pass
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.