Blog

How to Prepare for Coding Competitions and Hackathons

Coding competitions and hackathons look similar from the outside, but they reward different things. A contest rewards solving well-defined algorithm problems quickly and correctly. A hackathon rewards getting a working, demonstrable project built in a day or two. Prepare for them differently: for contests, practise problems under a timer; for hackathons, practise building small projects fast and working in a team.

Pick the right target first

Coding contests give everyone the same problems and a clock. Scoring is automatic, and you are ranked against other participants. Regular online contests include Codeforces rounds, AtCoder contests, CodeChef Starters and the weekly LeetCode contests. Check each site’s calendar for the next dates.

Be careful with older lists, including ones on other blogs. Google Code Jam, Kick Start and Hash Code were discontinued by Google in 2023, and the TopCoder Open was reported to end after 2023. Meta Hacker Cup has run annually, but check its official page for whether and when the current edition happens rather than assuming.

Hackathons are events where teams build a prototype around a theme and present it to judges. Examples that recur each year are student hackathons listed by Major League Hacking (its 2026 season ran from July 2025 to June 2026), and the NASA Space Apps Challenge, which in 2026 is scheduled for November 14 and 15 (see the official Space Apps site, as of October 2026). Many companies and universities also run their own.

Preparing for coding contests

1. Know the core toolbox

Most beginner and intermediate contest problems come from a short list of topics. Learn them in roughly this order:

  1. Arrays, strings, sorting and binary search
  2. Hash maps and sets, counting, prefix sums
  3. Two pointers and sliding window (see our sliding window post)
  4. Recursion, backtracking, greedy choices
  5. Graphs: BFS, DFS, shortest paths
  6. Dynamic programming
  7. Basic number theory (gcd, modular arithmetic) and bit tricks

You also need to read constraints. If n is up to 105, an O(n²) solution will time out and you need O(n log n) or better. If n is at most 20, exponential search is fine. Deciding the target complexity from the limits is half of solving a contest problem. Our time complexity post covers this.

2. Pick one language and learn its fast paths

Use one language you can write without thinking. C++ is the most common in competitive programming because of its speed and the standard library; Python and Java are also accepted on most sites and are fine for learning and for easier rounds. Whatever you choose, know:

  • How to read input quickly. In Python, read everything at once instead of calling input() in a loop.
  • Your language’s sort, heap, dictionary, set and deque.
  • How integers behave. Python integers do not overflow; C++ int and Java int do, so use long long or long when sums get large.
import sys

def main():
    data = sys.stdin.read().split()
    n = int(data[0])
    nums = list(map(int, data[1:1 + n]))
    print(sum(nums))

main()
# input:  3\n1 2 3
# output: 6

3. Practise in a way that builds contest skill

  • Solve by difficulty ladder. Choose problems slightly above what you solve reliably. Most of the time you should be able to solve them after 20 to 40 minutes of thought. If you cannot after that, read the editorial.
  • Always read the editorial afterwards, even for problems you solved. A different approach is where new techniques come from.
  • Re-solve problems you failed a week later without looking. This shows whether you learned the idea or just the code.
  • Keep a log of mistakes: wrong answer from an off-by-one, time limit from the wrong complexity, missed edge case. Patterns appear quickly.
  • Do virtual contests. Codeforces and AtCoder let you replay past rounds with the same timer. This is the closest practice to a live round.

If you are still building the basics, a guided course is more efficient than random problems. AlgoCademy’s interactive lessons walk through topics like sorting, hash tables and dynamic programming step by step before you attempt contest-style problems.

4. Prepare your contest-day routine

  1. Read all problems first, or at least the first few, and rank them by how sure you are of the approach.
  2. Solve the easiest first. Early points are cheap and settle your nerves.
  3. Before coding, write the idea in two lines and check it on the sample and on one edge case you invent (empty input, a single element, all equal, maximum size).
  4. If you have been stuck for 15 to 20 minutes with no new idea, switch problems. Come back with fresh eyes.
  5. Check the penalty rules before the contest. In some formats a wrong submission costs time or points, so test before you submit.
  6. Stress-test when you can. Write a slow brute force and compare it with your solution on random small inputs. It finds the bugs that samples miss.

Preparing for hackathons

1. Learn one stack you can ship with

You will not have time to learn a framework during the event. Choose a combination you already know well enough to build a simple app end to end, for example a React front end with a small Node or Python API, or a Python script with a minimal web UI. Practise building the same skeleton from scratch in one or two hours until it is routine. Know how to deploy it somewhere a judge can open it, since a live link beats a screen recording.

2. Prepare, within the rules

Many hackathons require that the project be started during the event. That usually allows general tools, libraries and your own boilerplate, but not a project you already built. Read the rules and ask the organisers if unsure. Things worth having ready:

  • A project template that runs and deploys in minutes
  • Accounts and API keys for services you might use (cloud hosting, maps, a language-model API, a database), created before the event
  • A Git repository workflow the team agrees on: branches, who merges, small commits
  • A slide or README template for the final demo

3. Build a team that covers the gaps

A team of three or four usually works best if the skills overlap a little: someone strong on the back end, someone on the front end or design, and someone who can own the demo and the story. Agree before the event on how you decide disagreements, because there is no time to argue for an hour on the second day.

4. Plan the 24 or 48 hours

  1. First hour: pick one problem and one core feature. Write a one-sentence description: “X helps Y do Z.” If you need two sentences, the scope is too big.
  2. Get a thin end-to-end version working early, even if it uses fake data. Everything after that is improvement, and you always have something to show.
  3. Cut features as the clock runs. Decide what you will drop, and when, before you are tired.
  4. Freeze new features a few hours before the deadline. Use the time to fix bugs, deploy and rehearse.
  5. Prepare the demo. Judges often see many projects in a few minutes each. Show the problem, show the product doing the one thing it does well, and say what you would build next. Rehearse it twice, with a backup recording in case the network fails.
  6. Sleep a bit. A tired team makes the kind of mistakes that break the demo.

Common mistakes

  • Only solving easy problems. It feels productive, but ratings and rankings move when you work on problems you cannot yet solve.
  • Reading the editorial too soon, or never. Struggle for a fixed period, then read it.
  • Not testing edge cases before submitting a contest answer.
  • Trying to build too much at a hackathon. A polished small project beats a broken ambitious one.
  • Leaving the demo to the last ten minutes.
  • Treating a bad result as a verdict. Ratings fluctuate, and most participants in either kind of event do not win. The practical return is the skills and the people you meet.

After the event

For contests, upsolve: solve the problems you could not finish, and read the top solutions to the ones you did. For hackathons, write down what worked and what did not, clean up the repository, and add the project to your portfolio with a short description. Keep in touch with teammates and mentors; those contacts tend to be worth more than the prize. If you are weighing how much competitive programming matters for jobs, read this post.

A lesson in AlgoCademy: the step to write, a picture of what it does, the line written in the editor, and the check: Step 2 passed

Before you go

Start thinking like a software engineer.

Learn to code and solve interview problems, one small, checked step at a time.

Free, no card needed. Or look around first

By continuing you agree to the Terms of Service and Privacy Policy.