12 ms·
Competitive Programmer's Handbook (2017) [pdf]
- sdan 8y agoOnly book I used for USACO.
- yodsanklai 8y agoI see in the comments that some people conflate competitive programming and technical interviews. Technical interviews (at least in companies such as facebook and google) are usually much easier than competitive programming problems. The problem you find on leetcode for interview preparation would be considered beginner problems in competitions such as google code jam.
- blocked_again 8y ago> Technical interviews (at least in companies such as facebook and google) are usually much easier than competitive programming problems. Probably. But if you are a student outside U.S where the opportunities are an order of magnitude less the only way to even land an interview with these companies is by doing competitive programming. Google selects students through APAC test in Asia where you have to be top n% in the leaderboard to even get an interview. Doing leetcode and all would not take you anywhere in these contests as you are competing with hardcore student programmers who have been practicing competitive programming their entire University life in search of an escape from the middle class. All the persons I know of in my country who works at Google or Facebook got their job through competitive programming.
- bjourne 8y ago> All the persons I know of in my country who works at Google or Facebook got their job through competitive programming. Are any of them bad developers?
- blocked_again 8y agoThe general trend is that students do either competitive programming or development. Most students who do competitive program hardly work on any personal projects or open source as it is of almost zero value when it comes to campus placements. Companies like Flipkart, Morgan Stanely, Goldman, Amazon, Cisco etc conducts a competitive programming test as the first round in Universities. The remaining rounds are mostly data structures and algorithm/DBMS questions taken from GeeksForGeeks. Very few companies ask questions about development, personal projects, open source contributions etc. If a student does only development and hardly do any competitive programming it is very difficult for them to pass the first round.
- RedGreenCode 8y agoMost people who are doing competitive programming aren't good at the harder problems. For example, there are >2500 people listed on the TopCoder Top Ranked Algorithm Competitors page (https://community.topcoder.com/tc?module=AlgoRank https://community.topcoder.com/tc?module=AlgoRank), but only the top 115 or so are Red, and only about 415 more are Yellow. A programming contest, even if you just do the easy problems, can be a more enjoyable way to practice for interviews than reading a book or even going through online puzzles like those on LeetCode.
- qntty 8y agoHas anybody gotten into this kind of programming post-college? Are there communities outside of high school and college competitions for this sort of thing?
- dominotw 8y agoYes they are called job interviews these days :d
- NetOpWibby 8y agoLOL
- bitL 8y agoHe's not joking though. I've experienced 3 rounds of stupid tricky questions followed by a 4 hour "take home" project at a UK startup in Deep Learning before they were willing to even send flight tickets to London, and the feedback I've received was so comical that I almost wrote a blog post about it (I still might). Another robotic startup in SV grills with 6-hour stupid codility tests as a first phase (i.e. waste 6 hours just as a handshake). Not sure if they think time grows on trees or people have no other things to do just to pretend a day has 48 hours. I took those to see what the interviews are these days to stay fit, and I must say it's like a panopticon of Google-wannabes for uncompetitive salaries and useless equity with bad liquidation preference.
- NetOpWibby 8y agoOh I agree! Not sure who downvoted me but I’ve been dealing with the same shit for quite some time (https://news.ycombinator.com/item?id=16127697 https://news.ycombinator.com/item?id=16127697). The shit is ridiculous. EDIT: Please write that blog post!
- banachtarski 8y agoThe problem is, for every person like you, there's a person like me that actually likes those types of challenges and wouldn't actually mind being thrown into that type of gauntlet. My years of experience be damned.
- sigsergv 8y agoThis book seems very useful for a job exams preparation.
- xetur 8y agoThis was the first resource I used to help me prep during my most recent interviews. Read and implement the examples yourself.
- tomkwong 8y agoNice! Reading through this doc is like going back to Computer Science classes again.
- legohead 8y agoSeemed interesting up until the "Shortening code" section, that'd drive me mad.
- slinger 8y agoWhy?
- chris11 8y agoCode should be written for readability, not typing speed.
- thallium205 8y agoBut if you're in a competitive environment that requires speed, why would you write for readability?
- victords 8y agoThis is not production quality code that is running on some important business. It's competitive programming. Speed is the goal here.
- dang 8y agoPrevious discussion at https://news.ycombinator.com/item?id=14115826 https://news.ycombinator.com/item?id=14115826.
- smnscu 8y agoThis is a good resource that I'm currently going through to prepare for interviews. Another one would be Competitive Programming (3rd edition) [1] but for general interview skills the Codility lessons are also OK [2]. 1 - https://www.amazon.com/Competitive-Programming-3rd-Steven-Halim/dp/B00FG8MNN8 https://www.amazon.com/Competitive-Programming-3rd-Steven-Ha... 2 - https://drive.google.com/open?id=1WjXxbdle0_Syip_LygBpnZkfHvqST34s https://drive.google.com/open?id=1WjXxbdle0_Syip_LygBpnZkfHv...
- partycoder 8y agoThis book gets to the point fast. But for the fundamentals this book serves more as a refresher than a course. Skiena and Sedgewick both have excellent books and online courses if you need more depth. A nice thing about this book is that the full TeX source is on github.
- partycoder 8y agoThere are some sections that are a bit dense and may require some additional work. The string algorithms section is very dense compared to the rest.
- zerr 8y agoThe most irritating thing with these competitive/algo stuff is that no matter how many times you master it - eventually you always forget it, because you don't need it on a daily (or more like yearly) basis in the real world.
- gaius 8y agoThat’s the entire point of those kinds of interviews. It’s a strong filter for “recent graduate” while maintaining plausible deniability for ageism. It has a secondary effect of filtering for “willing to do unpaid overtime”.
- hkon 8y agoI think also the interviewer gets to feel smart. Always nice to have the answers.
- tytytytytytytyt 8y agoYeah, right. Clearly they have nothing better to do and are all egomaniacs.
- fjsolwmv 8y agoMaybe it's just a way to provide a fair test that anyone with ability can pass with a little practice?
- zerr 8y agoI wouldn't call it "a little practice". There are people who are "into" competitive programming and there are people who aren't, and those "fair" tests are skewed towards the former group. The worst thing is that the actual job has nothing to do with the competitive programming at all.
- gaius 8y agoAnother filter for age is that 20-something’s are more likely to have time for this whereas older people may have more time commitments already People in their 20s and 30s now will regret not stamping out ageism when they hit their 40s and 50s, as they inevitably will
- vermooten 8y agohe lost me at C++
- donttrack 8y agoI would watch programming contests live streams.. Are there any available?
- saagarjha 8y agoIn my experience, most of the time goes into coming up with an algorithm or debugging. I don’t know about you, but I don’t think those would be particularly interesting to watch.
- donttrack 8y agoI am mostly just fascinated by people able to stream their coding. I think most of my stream would consist of googling stuff and procrastinating on hacker news and tabloids
- descrip 8y agoPetr usually posts screencasts on Youtube: https://www.youtube.com/user/petrmitrichev https://www.youtube.com/user/petrmitrichev
- tedmiston 8y agoNot sure if that's a thing but I've heard of developers streaming their screen on nights and weekends on something like Twitch.
- joshvm 8y agohttps://www.reddit.com/r/WatchPeopleCode/ https://www.reddit.com/r/WatchPeopleCode/ There was a HN discussion recently about programming livestreams.
- letslightafire 8y agotwitch.tv/devwars is a great competition. 3 vs 3 and you have an hour to make a better website than your competitor.
- joshvm 8y agoI like this book, but I have some reservations for using it for interview practice. There is no discussion on implementation of some of the algorithms, which may be relevant in an interview (e.g. if you're not allowed to use std::sort). There are also a lot of topics where there's a brief overview of the algorithm, but no code - e.g. the geometry section is interesting and has some useful ideas, but no implementation. This gets worse as the algorithms get more complicated, and some quite difficult topics get a cursory glance. For the general categories of problems that you find on e.g. LeetCode or Intervewbit, this book is really useful. It's a good, practical, companion to a proper algorithms textbook. Perhaps most irritating - if using this for prep - is that there are virtually no case studies, and the case studies that are in there assume a lot of code which isn't in the book (either boilerplate or assistance functions). This book would be incredibly valuable if each chapter had a list of example problems (solved or unsolved) to see how things are applied.
- mindfulplay 8y agoI wonder if there is something similar to this but for pragmatic, design-oriented challenges. Writing obfuscated code in the shortest amount of time is akin to the people who change tires during a race car competition. I would love to see challenges where you build the race car parts instead. Boring but immensely more useful.
- nojvek 8y agoIs there a printed hard copy version available as a book? I’d love to buy it. I’m a big fan of highlighting and annotating books with a pencil. This is a great summary to a ton of CS algorithms and datastructures. Thanks for compiling this.
- johnsonjo 8y agoYeah the author actually came out with a physical book that he published with springer. It’s linked here [1]. I believe it’s the same book just with extra materials. [1]: https://cses.fi/book.html https://cses.fi/book.html
- mgeorgoulo 8y agoChapter 8.1 shows an awesome algorithm!
- Fazel94 8y agoIf you wonder why you need to learn competitive programming when you can just look it up? I would like to refer you to B.F.Skinner's quote on education: "Education is what survives when what has been learned has been forgotten."