Search
⌘K

Leetcode 815. Bus Routes

Given repeating bus routes and start/target stops, find the minimum number of bus rides required to go from source to target (or -1 if impossible). This is solved by modeling routes/stops as a graph (e.g., routes as nodes connected when they share stops) and performing BFS to find the shortest transfer path — note constraints: up to 500 routes and 1e5 total stop entries.

Asked at:

Uber

Amazon

Amazon

PayPal

Coupang

Coupang


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Early May, 2026

Amazon

Amazon

Senior

Early April, 2026

Uber

Senior

Early February, 2026

Uber

Mid-level

Your account is free and you can post anonymously if you choose.