PracHub
QuestionsLearningGuidesInterview Prep

Quick 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.

  • medium
  • Google
  • Coding & Algorithms
  • Software Engineer

Return Words Matching a Typed Prefix

Company: Google

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

Given words and a query prefix, return all words starting with that prefix in lexicographic order. Implement: ```python def prefix_matches(words: list[str], prefix: str) -> list[str]: pass ```

Quick Answer: 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.

Return all words that start with a given prefix.

Examples

Input: {"words":["car","cat","dog"],"prefix":"ca"}

Expected Output: ["car","cat"]

Explanation: Two matches.

Input: {"words":[],"prefix":"a"}

Expected Output: []

Explanation: Empty.

Last updated: Jul 4, 2026

Loading coding console...

PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Count Overlapping Rectangle Updates on a Grid - Google (hard)
  • Find A Threshold-Limited Path With Minimum Required Safety - Google (medium)
  • Filter Repeated Robot Status Messages - Google (medium)
  • Minimize Direction Violations in a Directed Road Network - Google (medium)
  • Find the Largest Monotone Increasing Number - Google (medium)