Free Programming Books (and Places to Practice)
Hacker News recently rediscovered the Competitive Programmer's Handbook by Antti Laaksonen. It's a free PDF covering the algorithms and data structures that show up in programming contests: sorting, dynamic programming, graphs, trees, and more. A more polished edition is published by Springer.
Much of the HN discussion asked whether this kind of skill still matters now that AI can write code. I think it does. Working through hard problems is good exercise for your brain, even when your day job looks nothing like a contest.
Read, then practice
Reading a programming book is only half the work. The ideas don't really stick until you type the code yourself, get it wrong, and fix it. Here are some places to practice:
- Exercism is free, covers dozens of languages, and offers mentoring from real people. I wrote about Exercism before and I still like it.
- CSES Problem Set is the companion to the handbook, so you can practice each chapter's ideas right after reading it.
- Advent of Code is a puzzle a day every December, with a fun story and a big community.
- Project Euler has math-flavored problems that reward clever thinking more than brute force.
- Rosalind teaches programming through bioinformatics problems.
- Codewars offers bite-sized "kata" you can solve in many languages.
- Codeforces runs regular contests if you want to compete.
- LeetCode is the usual stop for interview prep.
Online judges
An online judge takes the code you submit, runs it against hidden test cases, and tells you whether it's right and fast enough. You get "Accepted," "Wrong Answer," or "Time Limit Exceeded." That instant feedback is what makes them so good for practice. An older HN thread about the handbook, from 2017, pointed to several:
- UVa Online Judge is one of the oldest, with thousands of problems. It pairs well with the book Competitive Programming by Steven and Felix Halim, which maps its chapters to UVa problems.
- USACO Training is the USA Computing Olympiad's training pages. The problems unlock step by step as you solve them.
- TopCoder is a long-running contest site. Its Marathon matches are two-week optimization problems, a nice change from short puzzles.
- HackerRank is often used by companies as a first hiring filter, so practicing there is practical.
- Kattis is used by many university contests and has a clean interface.
- CP-Algorithms isn't a judge. It's an English translation of the Russian e-maxx site, with clear write-ups of the algorithms that judges test.
Google Code Jam came up in that thread too, but Google ended it in 2023.
More free books
See also my older list of Books about Computer Programming.
Tags:
programming,
books,
free
← Back home