Live data from Hacker News

Competitive Programmer's Handbook (2017) [pdf]

cses.fi

21–30 of 127 posts

Re: Competitive Programmer's Handbook (2017) [pdf]

#21
post #3

Earlier quoted context omitted.

Yes they are called job interviews these days :d

LOL

He'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.

Re: Competitive Programmer's Handbook (2017) [pdf]

#22
post #9
post #2

Has anybody gotten into this kind of programming post-college? Are there communities outside of high school and college competitions for this sort of thing?

As few comments already mentioned, post college, preparing for this type of thing immensely helps in job interviews. I find it very hard to clear job interviews and in 2017 alone, I appeared for ~25 job interviews. I'm very convinced that competitive programming skills gives you a leg up in job interviews. Many people may already may know this, but Peter Norvig indicated that it correlates poorly with on the job perf…

Well, I think you're kind of misrepresenting his point as "competitive programming doesn't improve your programming abilities".

It's not that competitive programming correlates poorly with job performance; it's that, given you've been hired by Google, being a competitive programmer correlates poorly with job performance.

Hypothetically, let's say there's 2 dimensions for a programmer's ability, competitive programming and job experience. Each of these is distributed independently from 0-10. You get hired by Google if competitive programming + job experience > 10. However, let's say that for their actual job performance, it's 0.5 x competitive programming + 1.5 x job experience.

You now have a case where competitive programming could correlate poorly with job performance at Google, despite having a positive correlation in general.

Re: Competitive Programmer's Handbook (2017) [pdf]

#23
This 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.

Re: Competitive Programmer's Handbook (2017) [pdf]

#24

Seemed interesting up until the "Shortening code" section, that'd drive me mad.

Another reason for shortening code in programming contests (apart from being able to type and edit/iterate faster) is that it helps you avoid errors. For example, in the heat of the moment and under intense time pressure (e.g. you have finally figured out the algorithm to solve the problem, but you have only 13 minutes left to implement it or whatever), it's easy to write code like this:

    for (int i = 0; i 
instead of what was intended (j So if you have (in your pre-written library of snippets) a macro like

    #define FOR(i, n) for(int i = 0, _n = n; i 
then you can write:

    FOR(i,n) FOR(j,n) {
        ...
(the _n in the macro is for cases like FOR(i, v.size()) to avoid recomputation) and at least avoid that particular error. Of course other sorts of silly errors are still possible; some examples here: https://www.quora.com/What-is-the-worst-mistake-youve-made-i...

Re: Competitive Programmer's Handbook (2017) [pdf]

#26
post #22
post #9

Earlier quoted context omitted.

As few comments already mentioned, post college, preparing for this type of thing immensely helps in job interviews. I find it very hard to clear job interviews and in 2017 alone, I appeared for ~25 job interviews. I'm very convinced that competitive programming skills gives you a leg up in job interviews. Many people may already may know this, but Peter Norvig indicated that it correlates poorly with on the job perf…

Well, I think you're kind of misrepresenting his point as "competitive programming doesn't improve your programming abilities". It's not that competitive programming correlates poorly with job performance; it's that, given you've been hired by Google, being a competitive programmer correlates poorly with job performance. Hypothetically, let's say there's 2 dimensions for a programmer's ability, competitive programmin…

Berkson’s paradox

Re: Competitive Programmer's Handbook (2017) [pdf]

#27
post #17

Earlier quoted context omitted.

Code should be written for readability, not typing speed.

But if you're in a competitive environment that requires speed, why would you write for readability?

Because you probably have to re-read some, if not most, of the code while working through a solution.

Re: Competitive Programmer's Handbook (2017) [pdf]

#28
post #2

Has anybody gotten into this kind of programming post-college? Are there communities outside of high school and college competitions for this sort of thing?

Yeah, I think they are a terrific way to "keep your sword sharp". Jump start the neurons in the early AM or lazy summer day. As well as a way to learn new algorithms, new languages via problem solving.

Code Jam had a particularly juicy one in the recent Qualifying Round, that could easily be part of a modern shadow rendering game engine. Just to put it into perspective, only around 1000 out of 25000 entrants were able to solve the large data set in the allotted time!

Google Code Jam 2018 Qualifying Round Problem D: Cubic UFO

https://codejam.withgoogle.com/2018/challenges/0000000000000...

Incidentally, I don't really learn a lot from books or tutorials such as the one linked. But rather from the contest analyses and top winners code solutions.

Post reply on HN