Ubisoft interview question

Write an algorithm that checks if an NPC is hit by an explosion.