Domanda di colloquio di Aptiv

Difference between HW and SW interrupt? What does volatile do?