Katkat

Return Words Matching a Typed Prefix

GoogleSoftware Engineer · Onsite

Last 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