New
The Learning module is now live
See what's new
×
Question Bank
Learning
NEW
Pricing
Blog
Forum
HOT
JobRadar
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
Coding Question
Hack2hire 50 Picks
AI Insights
Quick Summary
Navigate a 2D grid from a starting point to a destination using designated transportation modes.
Paths are restricted to contiguous cells sharing the same mode identifier.
Identify the mode that minimizes total travel time, using lowest cost as a tiebreaker.
What This Tests
Modeling 2D grids as weighted graphs for pathfinding.
Implementing priority queue driven shortest path algorithms like Dijkstra.
Handling multi-criteria optimization with lexicographical tie-breaking.
Tracking traversal state and avoiding redundant visits efficiently.
Common Patterns
Graph Traversal
Heap / Priority Queue
Breadth First Search
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Accepted
7.4k
/14.2k
Acceptance Rate
52.4%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.7-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
grid =
modes =
costs =
times =
Output
Expected