Competitive Programmer's HandbookAntti Laaksonen
Competitive Programmer's Handbook
by Antti Laaksonen · first published 2018
19mentions
11recommended by
17HN commenters
2017–2026first – last mentioned
65% recommend35% neutral
Free book on competitive programming techniques.
Affiliate links. As an Amazon Associate I earn from qualifying purchases.






Data structures and algorithms: "Competitive Programmer’s Handbook" by Antti Laaksonen (https://cses.fi/book/book.pdf). Operating systems: "Operating Systems: Three Easy Pieces" by Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau (http://pages.cs.wisc.edu/~remzi/OSTEP/).
on “Ask HN: What is one great, easy-to-read book about CS that is not widely known?” ↗I've used sites like these when I am stuck with a problem and I would like a hint. But learning the theory is important. The resources I've used recently to train myself are: - Competitive programmer's handbook: https://cses.fi/book.html - InterviewBit: https://www.interviewbit.com/ - Sedgewick's DS&A course/book https://www.coursera.org/learn/algorithms-part1 http://algs4.cs.princeton.edu/home
I suggest this book the Competitive Programmer's Handbook https://cses.fi/book.html
on “Hacking a Google Interview (2009)” ↗Skimming through the ToC this looks similar to Antti Laaksonen's Competitive Programmer's Handbook [1], which I would also recommend. [1] https://cses.fi/book/index.html
on “Principles of Algorithmic Problem Solving (2017) [pdf]” ↗I would consider there are three general areas to work on for interviewing 1. Data Structures & Algorithms 2. Domain Knowledge 3. Interviewing Practice Each section is somewhat independent, and you should have a strategy for each 1. Data Structures & Algorithms Many people dislike this section as it doesn't represent the day-to-day work of an engineer. But nothing is going to change in
on “Ask HN: How to best utilize a 6 months sabbatical to improve technical skills” ↗You have entered the world of "competitive programming". Companies have started to incorporate competitive programming problems into their interview processes. They're hard, and often don't overlap a lot with what you may do at work, but there's not much you can do about it other than to prepare. A good book is "Competitive programmer's handbook", available for free in https://cses.fi/book.html.
on “Ask HN: How to not fail on coding interview questions?” ↗>Is there a proper book(s)/source(s) that I should follow? You may find these book useful: Competitive Programming 3 by Felix Halim and Steven Halim. Competitive Programmer’s Handbook (https://cses.fi/book/index.html) >I have rarely found the need to code one up in my job Depending on your job profile, these data structures may not be used at all. But programming puzzles have become the norm
on “I’m a very slow thinker (2016)” ↗When starting with Leetcode you face two questions: 1. Which ones should I do to be prepared? 2. For a given problem how do I find the knowledge that should have helped me recognise and solve it? Imho, the Competitive Programmer’s Handbook [1] does answer these, every trick and pattern is explained in the most succinct way, in the order you would want to progress on leetcode to see all the basi
on “Avoiding Leetcode Anxiety” ↗In case you want to go for something aimed at competitive programming have a look at the "Competitive Programmer’s Handbook" https://cses.fi/book/book.pdf
on “Ask HN: Looking for a book on algorithms and data structures” ↗Skip the service, don't skip over the theory, the handbook ought to be enough https://cses.fi/book/book.pdf Just be useful.
Worth mentioning that there's a companion book to this website: https://cses.fi/book/book.pdf The problems are indeed of very high quality. But it can be a difficult place to start. For example, even the very first problem has an overflow gotcha built into it. Also, Kadane's Algorithm appears as an early problem even though several mathematicians and computer scientists failed to discover it: htt
on “Role of Algorithms” ↗The visual is directly from here (I recommend you give it a read if you want to grasp the full intuition on how a Fenwick tree works (page 97)): https://cses.fi/book/book.pdf I should have included the full visuals which are included there and I can see your point on why people would get confused by that visual - so I'll make a note to include the full image when I have more time. Thank you for t
on “Quicksort explained IKEA-style” ↗> tips anyone? :) They're not as magical as they seem, you just need some practice. Read over the dynamic programming section in https://cses.fi/book/index.php (pdf link near the top is the free English version), then do a few on https://cses.fi/problemset/ . You'll be able to handle the AoC dynamic programming ones with _no_ problem at all.
on “Advent of Code 2025: Number of puzzles reduce from 25 to 12 for the first time” ↗Learning vim and reading "Competitive Programmer’s Handbook" by Antti Laaksonen in preparation for programming interviews next year!
on “Ask HN: What are you looking forward to learn in 2020?” ↗…originally in Russian, by Max Ivanov. Another site that now offers some interactive leetcode-like functionality is USACO (The United States of America Computing Olympiad)[1]. Among other guides, they reference Competitive Programmer's Handbook (CPH) by Antti Laaksonen[2](PDF) https://usaco.guide/ https://usaco.guide/CPH.pdf
on “Algorithms for competitive programming” ↗