The Minimum Time Visiting All Points problem gives you a list of 2D points that must be visited in order. You move from one point to the next, where each second you can move at most 1 unit horizontally, 1 unit vertically, or 1 unit diagonally. Find the minimum time to visit all points in the given order. This Minimum Time Visiting All Points coding problem tests geometric distance intuition using the Chebyshev distance formula.
Meta, Amazon, Google, Bloomberg, and Media.net ask this easy-level problem to test whether candidates know the Chebyshev distance metric. The minimum time to move from point A to point B in 8-directional movement is max(|dx|, |dy|) — the Chebyshev distance. The array, math, and geometry interview pattern is demonstrated cleanly here.
Chebyshev distance computation. For each consecutive pair of points (p1, p2), compute dx = |p2.x - p1.x| and dy = |p2.y - p1.y|. The minimum time is max(dx, dy). Sum these values for all consecutive pairs. This works because diagonal movement covers both dimensions simultaneously, making the bottleneck the larger of the two differences.
Points: [[1,1], [3,4], [-1,0]].
|dx| + |dy| (correct for 4-directional, not 8-directional).Memorize the three movement metrics: Manhattan distance (|dx| + |dy|) for 4-directional movement; Chebyshev distance (max(|dx|, |dy|)) for 8-directional movement; Euclidean distance for actual straight-line travel. The Chebyshev metric appears in grid-based games, robot navigation, and board game problems. For easy problems, the key skill is recognizing which metric applies — getting this right immediately signals strong geometric intuition to interviewers.