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
Atlassian
Coding Question
AI Insights
Quick Summary
Simulate two vehicles traveling along distinct linear routes to a single destination.
Assign each passenger to the vehicle that reaches their location first based on cumulative travel duration.
Return the ordered list of passengers collected by each vehicle.
What This Tests
Linear graph traversal and path simulation
Hash map usage for routing and timestamp tracking
Event-driven assignment and tie-breaking logic
Sorting by arrival times for final ordering
Common Patterns
Hashing
Graph Traversal
Sorting
Collapse
Hint 1
Hint 2
Hint 3
What Interviewers May Ask Next
Accepted
830
/2.1k
Acceptance Rate
38.8%
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
roads =
starts =
people =
Output
Expected