A few days back I had an interview, and I was asked to write a program in C which crashes the system/which shuts down the system. Needless to say I felt pretty dumb having no clue on how to even approach 🙁
Still I gave it a try, writing programs which use a lot of memory. But my interviewer was not satisfied with any of my techniques.
It’s easy to write a program that invokes undefined or implementation-defined behavior. Some of those programs could potentially crash the system.
But by definition, this is inconsistent. And modern OSes take pains (though not 100% successfully) to prevent a rogue app from crashing the system.