I pulled all-nighters to get some reports done. I'd had a can of relentless in the afternoon which with my body weight, kept me wide awake till 6am. Feels terrible but I do enjoy the naps the next day. Just don't get into a routine of doing them or you'll mess up your sleep pattern.
I wouldn't do them for an exam, if you have minimal time. Pick the topics you know, make colourful mind maps for each then try to write from memory what you did on paper a couple of times, reverting back when you know you have it wrong. Get some sleep and try the memory game again before the exam. Worked for me!