← Google questions
CodingHardReported in a candidate post, Jul 2025

Shortest path with alternating edge colors (harder variant)

Filed under Google

You are given a directed graph with n nodes labelled 0 to n - 1. Each edge is red or blue, and the graph may contain self-edges and parallel edges. You are given redEdges and blueEdges, where…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Google questions

Collected from public candidate posts and coding forums. Updated Nov 2026.