← Back
00:00

Probe Collision Simulator

Lyft interview questions · Hard · Coding round · 6 tests

A line of probes is arranged from left to right. Each probe has a positive mass and a signed velocity. A positive velocity means the probe moves right; a negative velocity means it moves left.

Interface

type Probe = {
  mass: number;
  velocity: number;
};

simulateProbeCollisions(probes: Probe[]): Probe[]

Collision rules

Idle