← Amazon questions

Car collision problem

Filed under Amazon

There is an array of cars representing positions on the x-axis. They move at the same speed. Some cars move left (-1) or right (1). When two cars collide, the smaller one is destroyed. If both are the…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.