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

|Home/Coding & Algorithms/Amazon
Amazon logo
Amazon
Jun 4, 2026
mediumSoftware EngineerTechnical ScreenCoding & Algorithms
2
0
Loading...

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...