Question bank › Math
Dsa Math Medium

Curved Path Distances

You are given a 2D plane with points representing the vertices of a path. The path can intersect itself and may form various shapes. Your task is to calculate the total length of the path defined by the given points. The input consists of an integer N (the number of points) followed by N pairs of integers (x, y) representing the coordinates of the points in order. The output should be the total length of the path to two decimal places. Example Input: 4 0 0 3 4 4 0 1 1 Example Output: 7.41

Key concepts

geometrymatharrays

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.