Return Words Matching a Typed Prefix
Company: Google
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Onsite
Overview: 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.
Read the full Google Software Engineer interview experience this question came from
Examples
Input: {"words":["car","cat","dog"],"prefix":"ca"}
Expected Output: ["car","cat"]
Explanation: Two matches.
Input: {"words":[],"prefix":"a"}
Expected Output: []
Explanation: Empty.