Resolve Collisions Between Moving Asteroids

Read the full interview experience this question came from →

Quick Overview

Resolve all collisions among asteroids moving left or right along one line, preserving survivors in original order. Use a stack to model only opposing-direction collisions and repeatedly compare any current asteroid that survives a smaller opponent.

Resolve Collisions Between Moving Asteroids

Company: Amazon

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Overview: Resolve all collisions among asteroids moving left or right along one line, preserving survivors in original order. Use a stack to model only opposing-direction collisions and repeatedly compare any current asteroid that survives a smaller opponent.

Read the full Amazon Software Engineer interview experience this question came from

Amazon logo
Amazon
Jun 4, 2026
mediumSoftware EngineerTechnical ScreenCoding & Algorithms
4
0
Practice
Loading...