Think of asteroids moving toward each other as events in a processing pipeline. Each new event can cancel previous events sitting on a stack. You process them by , and the tricky part is handling every collision case: the new asteroid might destroy stack element, or several, or be destroyed itself.
Getting every case right without messy if-else chains is the test. Amazon asks stack simulation problems because they mirror order processing pipelines where later events (cancellations, returns) invalidate earlier ones. You'll walk away comfortable with stack-based event simulation.