I've found it's better to get a good night's sleep (or at least six hours) and wake up early to cram maybe one or two hours before your test, then ace the shit out of it while it's still fresh in your mind.
In my limited college experience "healthy food" (granola, beef jerky, cheese, celery with Nutella) seems to help you stay awake while cramming or writing papers at the very last moment slightly more than junk food. If you can sleep try to sleep a few hours since it'll help you calm down and retain the material a little better. Just drink a coffee or something if you still feel sleepy and study a bit more before test time.
Caffeine has its limits (Ever slept after drinking a cup? Strange dreams and missed courses incoming) so I would only drink you really, really want the boost.
At least you have the night before, I've written 6-8pg monstrosities 3-6hrs before they were due.
If it's just memorizing facts etc, you can do it - I still went for 6 or at least 4 hours of sleep, and I found it worked the best when I studied up until my normal bedtime or a bit later and then got up at like 3-6am (depending on my panic level) to cram for a few hours until the test. I always studied right until the moment of the test since it's easier to remember things for 30 minutes than overnight.
When you get the test, immediately flip through it and jot a few notes on the ones you know the answers for, so you don't forget while answering the other questions. Read the whole test before starting (so you can manage your time) and answer the ones you know first.
If you can at all avoid it though, it's far better to study less and sleep more. If the test involves any sort of thinking at all rather than just regurgitating facts, I'd stick to at least 6 hours of sleep unless you know already that you can think properly on little sleep - I can't.
I didn't really find that anything kept me up, even coffee. Mostly just panic, which is also why I could focus more waking up super early rather than staying up super late.
I did this all the time in college, but honestly I only managed it through sheer willpower. Caffeine and/or Sudafed never helped because it made me feel shifty and restless, like I needed to go walk or drive around aimlessly. All foods made me sleepy or gave me indigestion (if you stay up more than 24 hours you're going to get indigestion no matter what you eat.)
So outside of recommending, um, certain drugs (which I think may be frowned upon), just channel your anxiety into stubborn determination to beat the test.
Mnemonic techniques are very useful. In case of numbers (dates), you can use an old technique where you assign consonants to numbers:
0 = s
1 = t or d
2 = n
3 = m
4 = r
5 = l
6 = sh or ch
7 = k or g
8 = f or v
9 = p or b
Then you take two numbers and fill in random vocals to get proper words.
For example, in case of the french revolution (1789–1799), you can create "dog", "fabio", "dig", "pope". Then you take an area that you are familiar with, your home for example, and you assign the different dates to different rooms, preferably in a familiar sequence, like entering your home and going through all the rooms in specific order to get to the one furthest from the door. Then, say, the first room is your living room, and then you visualize in your living room a dog hanging from Fabio's hair while he is digging a hole for the Pope's body, while there's a French revolutionary standing a few paces away with a smoking gun.
It sounds difficult, but it's very useful for memorizing large quantities of numbers with no error.
I've pulled a few all nighters in college just before finals. I drank alot of caffeine to stay awake. Not the most healthy but once I crashed the exam was over with so it didn't matter. I also took short walks to prevent myself from falling asleep in my chair. I aced most of the exams but shortly forgot almost everything I crammed in after the exam was done.
I don't recommend doing what I did. It's healthier to study a little bit each day. You'll also have better long-term retention of the material that way.
5w6 or 9w1 sp/so/sx, I think
yes. I have been doing this all 4 years of my college career and I don't have much to show for it other than an above average GPA.... I basically procrastinated on almost everything. I only remember finishing a couple assignments ahead of time...not the best thing to do.