Determine if chasing points will meet

Quick Overview

This question evaluates understanding of pursuit curves, continuous dynamical systems, computational geometry, and numerical simulation, measuring the ability to reason about concurrent motion, convergence behavior, and numerical precision when multiple agents chase one another.

Determine if chasing points will meet

Company: Disney

Role: Machine Learning Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

You are given **N points** in 2D, indexed `0..N-1`, forming a cycle. - At time `t = 0`, point `i` is at coordinates `(xi, yi)`. - All points move **simultaneously** and continuously. - Each point moves with **constant speed** `v = 1`. - At any time `t`, point `i` moves in the direction of the **current position** of point `(i+1) mod N` (i.e., it “chases” the next point). ### Task Write a program that determines whether the points will **all meet at the same location at the same time**. If they do meet, output: 1. The meeting time `T`. 2. The meeting position `(X, Y)`. If they do **not** meet, output `NEVER`. ### Input - Integer `N` (`2 ≤ N ≤ 200`) - `N` lines of real numbers: `xi yi` ### Output - Either `NEVER`, or three real numbers `T X Y`. ### Requirements / Notes - Your numeric outputs should be within `1e-4` absolute error. - You may use numerical simulation (time-stepping) as long as it meets the error requirement and runs efficiently.

Overview: This question evaluates understanding of pursuit curves, continuous dynamical systems, computational geometry, and numerical simulation, measuring the ability to reason about concurrent motion, convergence behavior, and numerical precision when multiple agents chase one another.

|Home/Coding & Algorithms/Disney
Disney logo
Disney
Nov 1, 2025
mediumMachine Learning EngineerTechnical ScreenCoding & Algorithms
8
0

You are given N points in 2D, indexed 0..N-1, forming a cycle.

  • At time t = 0 , point i is at coordinates (xi, yi) .
  • All points move simultaneously and continuously.
  • Each point moves with constant speed v = 1 .
  • At any time t , point i moves in the direction of the current position of point (i+1) mod N (i.e., it “chases” the next point).

Task

Write a program that determines whether the points will all meet at the same location at the same time.

If they do meet, output:

  1. The meeting time T .
  2. The meeting position (X, Y) .

If they do not meet, output NEVER.

Input

  • Integer N ( 2 ≤ N ≤ 200 )
  • N lines of real numbers: xi yi

Output

  • Either NEVER , or three real numbers T X Y .

Requirements / Notes

  • Your numeric outputs should be within 1e-4 absolute error.
  • You may use numerical simulation (time-stepping) as long as it meets the error requirement and runs efficiently.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...