← Questions

Count simple paths whose labels match a prefix

0
GoogleCodingLast asked Aug 2026

A coding interview question asked in Google's first round (coding), last asked Aug 2026. It tests graphs, dfs and backtracking.

Every node of an undirected graph carries a one-letter label. Given a query word, count the simple paths (paths that never repeat a node) whose labels spell each prefix of the word.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Google · First round: coding · Last asked Aug 202645 min · Coding in a Google Doc, no syntax highlighting or autocomplete · No AI

What it tests

graphs · dfs · backtracking

Your code and the AI tutor open when you unlock this question.