Halloween SalePremium questions, over 30% offUnlock all premium questions for over 30% off
Find Minimum City Hops
Medium
You are given a list of cities, where each city is represented as a 3-character lowercase string. Two cities are directly connected if they differ in exactly one character position.
Given a startCity and an endCity, find the minimum number of hops to travel from startCity to endCity through the network of connected cities. Return -1 if endCity is not reachable from startCity.
...
Asked at:Amazon
More Amazon interview questions
- [CodeSignal] Drone Hub Travelmedium
- [CodeSignal] Minimum Security Groupsmedium
- [CodeSignal] Maximum Product Ratinghard
- [CodeSignal] Permutation Sorterhard
- [CodeSignal] Warehouse Emergency Deliverieshard
- [CodeSignal] Maximum Secure Deliveriesmedium
- Binary Tree Camerashard
- Maximum Interval Overlapmedium
OfferRetriever
Master technical interviews with real questions from top companies. Build your confidence and career.
LEGAL
© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.