New
ML System Design & SQL tracks just landed
See what's new
×
Question Bank
Pricing
Blog
Forum
HOT
JobRadar
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
Tesla
Coding Question
AI Insights
Quick Summary
Map each cumulative travel distance to an exact 2D coordinate along a polyline route.
For every computed position, identify the closest waypoint that falls within a given distance threshold.
Return the zero-based index of the qualifying waypoint, resolving ties by selecting the smaller index.
What This Tests
Linear interpolation and Euclidean distance calculations
Efficient traversal of sorted input arrays using stateful pointers
Floating-point precision handling in threshold comparisons
Trade-offs between preprocessing cumulative values and per-query scanning
Common Patterns
Two Pointers
Prefix Sum
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.6-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
Output
Expected