Why are dreams about failing exams so common? Why so many people have a dream in which they are just about to take a mandatory school exam and they're totally unprepared, or they've missed it because show up in the wrong day, or the exam is on the very next morning, etc.; and get extremely nervous and anxious, up to the point of waking up panting and taking several minutes to figure out it was all just a dream?

Or maybe they're only being whipped... that's so reassuring!

Is there a technical term denoting this kind of dreams? What's their nature? Is it specific to the Western world/culture? Are there other examples of it?
Yes this kind of dreams are commonly called nightmares. The reason we experience nightmares is to prepare us for threats in the real life.

"A dream-production mechanism that tends to select threatening waking events and simulate them over and over again in various combinations would have been valuable
for the development and maintenance of threat-avoidance skills."

http://www.unil.ch/files/live//sites/ln/files/shared/Revonsuo_1.pdf