FastPrepWord Chain Jumps in a Grid
Problems/Word Chain Jumps in a Grid

Word Chain Jumps in a Grid

Google logoGoogle● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionExamples

Problem statement

Source note: Google asked this as the second coding question in an L4 screening interview. The report describes a grid in which each move stays in the current row or column and lands on an entry whose first letter equals the current entry's last letter, and asks whether the top-left corner can reach the bottom-right one.

The report gave no limits, no examples and no word lengths, and its wording could also be read as a grid of single letters. Practice choices here: the cells hold words of 1 to 5 letters, a move may jump over cells, a one-cell grid counts as reached, and the grid is at most 100 by 100.

The judged task matches the report at about 75%.

You are given an m x n grid of words. You start on the top-left cell (0, 0).

In one move you may jump from your current cell to any other cell in the same row or the same column, at any distance, as long as the word in that cell starts with the last letter of the word in your current cell. For example, from "ab" you may jump to "bc", but not to "cb".

The problem statement continues
Pro

Examples

Example 1

grid = [["ab","ca","bc"],["dd","ee","cz"]]return = true
grid
0120abcabc1ddeecz
  • ab ends with b. In row 0, bc starts with b, so jump there, passing over ca.
  • bc ends with c. In column 2, cz starts with c, and it is the bottom-right cell.
02 · Example 2
FastPrep Pro
Reported in 1 Google interview this week

Unlock this recently reported problem

FastPrep Pro gives you full access to interview problems reported within the last week.

  • Full problem statement and constraints
  • 2 more worked examples, explained
  • Guided hints and editorial
  • Run your code on real test cases
$8.25/month

$99 billed yearly — or $19 month-to-month. Cancel anytime.

Free plan — 2 of 2 free unlocks used this week

More Google Phone Screen questions

  • Best Stock Trade with Buy and Sell DaysPHONE SCREEN · Seen Nov 2026
  • Dice-Walk Winning ProbabilityPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Lowest Common Ancestor in an N-ary TreePHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Apartment Housemate PreferencesPHONE SCREEN · Seen Nov 2026
  • Price at Query TimestampsPHONE SCREEN · Seen Nov 2026
  • Course Schedule Cycle DetectionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Logger Rate Limiter with Every-Arrival HistoryPHONE SCREEN · Seen Nov 2026
  • Minimum Total Layover WaitPHONE SCREEN · Seen Nov 2026
  • Reach a Destination Through Scheduled FlightsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Minimum Boards to Cover Roof HolesPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026

Similar questions at other companies

  • Number of IslandsAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Linked Merchants Within Two HopsStripe · PHONE SCREENStripe interview questions
  • Minimize CommuteDatabricks · OA · PHONE SCREENDatabricks interview questions
  • Route Graph Reachability with a Broken LinkFigma · PHONE SCREENFigma interview questions
  • Minimum Currency ConversionsEPAM · PHONE SCREENEPAM interview questions
  • Finite Web CrawlerMongoDB · PHONE SCREEN · ONSITE INTERVIEWMongoDB interview questions
  • Count Connected IslandsUber · PHONE SCREENUber interview questions
  • Currency Conversion RateBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Shortest Pin Path Through TopicsPinterest · PHONE SCREENPinterest interview questions
  • Clone a Connected GraphAbridge · PHONE SCREENAbridge interview questions

Interview reports that mention this question

  • Google L4 SWE Phone Screen: 1 Experience

Google interview experiences

  • Google ML Engineering Manager Onsite: 1 Experience
  • Google Experienced SWE First Round and Onsite: 1 Experience
  • Google AI Coding Interview and AI OA: 2 Experiences
  • Google SWE Intern Interview Results Timeline: 13 Experiences
  • Google L4 SWE Phone Screen and Kirkland Onsite: 1 Experience
All Google interview questionsSee Google hiring insights
CodePython 3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import heapq
from collections import defaultdict
 
class Solution:
def solve(self, values, queries):
# Build the adjacency structure
n = len(values)
graph = defaultdict(list)
for u, v in queries:
graph[u].append(v)
 
best = [float("inf")] * n
heap = [(0, 0)]
while heap:
cost, node = heapq.heappop(heap)
if cost > best[node]:
continue
Run and Submit unlock with Pro
FastPrep Pro
Reported in 1 Google interview this week

Unlock this recently reported problem

FastPrep Pro gives you full access to interview problems reported within the last week.

  • Full problem statement and constraints
  • 2 more worked examples, explained
  • Guided hints and editorial
  • Run your code on real test cases
$8.25/month

$99 billed yearly — or $19 month-to-month. Cancel anytime.

Free plan — 2 of 2 free unlocks used this week