
By Samuel Torres — Software & Cloud Engineer. 23+ production sites.
On November 21, 2026 I took part in the Google Core Hackathon End of Year on HackerRank: 4 algorithm problems and 150 minutes to solve them. Official results aren't out yet; they take at least a week. In the meantime I'm writing down what I learned, and this is the least technical post in the series. It's not the least important one, though: what to eat before and during a challenge like that.
It sounds like a side topic. It isn't. Two and a half hours of hard thinking wear you out, and you feel it. The way I see it, your head works like a muscle. Show up without eating, or straight off a heavy meal, and the first hour feels fine while the third one feels twice as long. That's exactly the stretch where you have the hard problems left and the least time.
Heads-up: this is general advice from someone who writes code, not medical or nutrition advice. If you have diabetes, an allergy, a diet prescribed by a doctor or any health condition, follow your doctor, not a blog post.
I'm also not going to give you calorie counts or numbers about how much energy the brain uses. There are plenty of loose figures online and I don't want to repeat one I can't back up. What follows is six simple rules and a sample schedule.
The 6 rules I follow
1. Your main meal, 1 to 2 hours before
Don't start the challenge on an empty stomach, and don't start it with lunch still sitting in your throat. Eat one to two hours before. That way the heavy part of digestion is done when you open the first problem, and you're not hungry yet when you reach the third.
This hackathon had an entry window from 10:00 to 10:30 in the morning. With a start like that, eating somewhere between 8:00 and 9:00 puts you in a good spot. If your challenge is in the afternoon, same idea: count back from the start time.
2. Nothing too heavy or too greasy
A heavy meal makes you sleepy. You know it from any afternoon after a big lunch: you sit down at the computer and your eyes start closing. In a timed challenge that's the last thing you want.
I'm not saying eat less. I'm saying eat something normal, something you know and that sits well with you. Challenge day is not the day to try a new restaurant or a hot sauce you've never had.
3. Water within reach
Put a glass or a bottle of water next to the keyboard before you start. Not across the room, not in the kitchen: next to you. When you're focused you won't get up for water; if it's right there, you'll drink it without thinking.
A practical tip: use one with a lid. A glass knocked over the keyboard halfway through is a very expensive way to lose ten minutes.
4. Go easy on the caffeine
If you drink coffee every day, have your usual coffee. If you don't, challenge day is not the day to start. The rule is simple: don't change your routine on that specific day.
The classic mistake is thinking "today I need to be extra sharp" and drinking three more coffees than usual. What tends to happen is the opposite of what you wanted: jitters, restless hands, a bathroom trip in the middle of a problem and, when it wears off, a crash. Energy drinks fall in the same bucket.
5. A snack at the halfway point
Over 150 minutes you'll want something around the middle. Have a small snack ready that you can eat in a minute without taking your eyes off the screen: fruit, a handful of nuts, that kind of thing. It shouldn't get your hands or the keyboard dirty, and you shouldn't have to prepare it.
The key is having it ready before you start. If you get up mid-challenge to look for food, open the fridge, think about it, get distracted… there go five or ten minutes, plus the thread of the problem you were on. In a timed challenge every minute counts: mine ran out with one problem submitted in the final minutes, and I still don't know if it passed.
6. Sleep the night before
This one matters most, and it's the one people skip. If you have to choose between two more hours of studying and sleeping, sleep.
Whatever you didn't learn in the past few weeks you won't learn at midnight before the challenge. Showing up tired, on the other hand, shows: you read a problem statement three times and it doesn't click, and you make silly mistakes. In a coding challenge the silly mistakes are the ones that eat the most time. In my case, on one problem only 1 of 10 test cases passed because I'd typed the letter o instead of the digit 0 in $pa[0]. That kind of bug is hard enough to spot when you're rested; tired, it's twice as hard. I cover those one-character mistakes in how to prepare for a programming hackathon.
A sample schedule

This is an example, not a recipe. Adjust it to what you normally eat and to the time of your challenge.
| When | What to do | Why |
|---|---|---|
| The night before | A normal dinner, then bed at your usual time | Showing up rested beats two extra hours of studying |
| Challenge morning, 1–2 h before | Oatmeal, or whole-grain toast with eggs, or yogurt | Something familiar that isn't heavy and keeps you going |
| Right before you start | Water by the keyboard, snack ready, your usual coffee (if you drink it) | So you don't have to get up during the challenge |
| Halfway through | Fruit or nuts and a sip of water | Eaten in a minute, no mess on the keyboard |
| After | Now eat whatever you want | You're done |
And what I'd avoid:
- A plate of heavy tacos right before. I love them, just not an hour before thinking about dynamic programming.
- Three more coffees than usual. More coffee isn't more focus.
- Skipping breakfast "to feel light". Light, yes. Empty, no.
- Candy as your only snack. A piece won't hurt, but it shouldn't be your plan for hour two.
Why this matters when there's a clock
In a hackathon like this one, the last minutes are worth the most. That's when you already have a working solution and you're trying for a faster one, or when you're submitting the last problem. In my case, Minimum Health ended at 11 of 15 test cases: the remaining 4 failed on time limits, not wrong answers. That wasn't a food problem; it was an algorithm problem. But that's exactly why you don't want to stack another problem on top: if you're tired, hungry or wired on coffee at that point, you make worse calls.
Food won't make you solve a problem you don't know how to solve. What it does is remove one distraction. And when there's a clock, removing distractions is half the job. That's why this topic goes hand in hand with staying calm when the clock is running: being rested and fed makes it a lot easier not to panic when the screen fills up with errors.
A quick checklist
The night before:
- Get the water ready (a bottle with a lid).
- Set the snack aside, within reach.
- Make sure you have what you need for your usual breakfast.
- Set an alarm early enough to eat 1–2 hours before.
- Go to bed at your usual time.
Challenge morning:
- Eat a breakfast you know.
- Your usual coffee, no more.
- Bathroom before you log in.
- Water and snack next to the keyboard.
- Open the challenge.
None of this is technical, and that's exactly why it gets forgotten. The rest of my hackathon prep is about code; this is the part that lets the code come out.
What I wouldn't do
- I wouldn't change what I eat on challenge day. No new diet, no new supplement, no energy drink I've never tried.
- I wouldn't stay up late studying the night before. A short review is fine; pulling an all-nighter isn't.
- I wouldn't leave the snack for "when I get hungry". By then you're deep in a problem and you won't get up.
- I wouldn't take food advice from a programming blog if I had a health condition. This one included. That's what your doctor is for.
Want to talk?
If you're getting ready for a hackathon or a technical challenge and want to compare notes, or you need someone who thinks just as methodically about your company's systems, reach out through contact. And if you want the technical side of this challenge, start with the first steps before writing a line of code.
Sources
- Challenge format (4 problems, 150 minutes, 10:00–10:30 entry window, HackerRank) and the results I report (Minimum Health 11/15 due to time limits; Maximum Earnings submitted in the final minutes; the letter
obug in$pa[0]): Samuel's own experience at the Google Core Hackathon End of Year (HackerRank, Nov 21, 2026). - The 6 rules and the sample schedule: Samuel's own experience and opinion from the Google Core Hackathon End of Year (HackerRank, Nov 21, 2026). General advice, not medical or nutrition advice.
About the author
Samuel Torres is a Software & Cloud Engineer at Conqr Digital Agency (Mexico City). He runs 23+ production WordPress sites and processed 80,000 documents with OCR + LLM. More at /en/about. Get a quote on WhatsApp in 2 min



