Readit News logoReadit News
zerr · 8 years ago
The 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.
inverse_pi · 8 years ago
It's not about needing it in "the real world". It's about having fun. It's about the adrenalin rushing through your veins as the clock ticking down. It's about burst of joy when your brain just clicks and the invisible wall falls down, showing a path to the solution. I still do Putnam and IMO every year, I also occasionally take an hour or two during work and just solve Math problems. Solving problems is a hobby, just like video games. There's nothin really practical about it and there doesn't have to be.
zerr · 8 years ago
What I'm saying is that aligning interviews to prefer candidates with this particular hobby (which is not related to the job) is not fair.
dmead · 8 years ago
if we're going to take the video game comparison further, then there is something better you could be doing with your time.
kamaal · 8 years ago
This is the case with anything you didn't discover it yourself but rather 'learned it', that's actually just a replaceable term for 'memorized it'.

People who discovered/invented these algorithms traversed several years of curiosity, blind alleys, dead ends, failures and successes. You can't possibly expect to get it all and make it up on memorization alone.

Algorithm learning is hard for the same reasons memorizing Math tables are hard.

As of today there is nothing novel about merely learning how a algorithm works and spitting it out in an interview, if anything it achieves the exact opposite goal of what it is supposed to.

Deleted Comment

xor1 · 8 years ago
This is true for lots of things though, right? Programming languages, spoken languages, mathematics, muscle mass...use it or lose it, but it gets easier to re-learn/re-gain everything each time. Plus you don't necessarily have to forget or lose it if you're able to set aside the time to maintain it.
Rarebox · 8 years ago
Exactly. Having the experience of solving difficult algorithmic puzzles under time pressure makes parts of software engineering (writing working code, debugging) easier, so you can focus on the hard parts. Algorithmically, almost anything written in the real world is trivial in comparison.

Deleted Comment

tzipp · 8 years ago
If you really needed to remember it, you could employ spaced-repetition: https://en.wikipedia.org/wiki/Spaced_repetition
JohnSz · 8 years ago
I use Spaced Repition for chess openings as I can't refer to a book while playing a tournament game. That's not the case for programming.
drharby · 8 years ago
Kek - i employed this technique in learning starcraft 2 openings. Def. Seperated the top 10% from top 5%
RockmanX · 8 years ago
The point is why people have to remember them ?

Why not look them up when necessary ?

maxerickson · 8 years ago
I guess most of the problems are relatively small, but for Advent of Code¹, the "competitive" people are finishing most of their solutions in a minute or two.

1. http://adventofcode.com/

svat · 8 years ago
How will you look it up when necessary during a programming contest (like the IOI/ICPC mentioned in the book)? It's usually not allowed by the contest rules to look up an entire book's worth.
jnordwick · 8 years ago
And if your teams algo and data structure knowledge isn't at the level where you know about these solutions or their applicability?

I have a checklist of possible interview topics and I think I might an esoteric data structure part to it (knowledge not code) and some implementation choice questions - given this situation and data, with these queries what would your data structures look like.

Maybe also a few quotations on the last paper they've read in CS or related topic.

fjsolwmv · 8 years ago
Why test for anything in an interview? Why not assume anyone can learn everything on the job?
svat · 8 years ago
I'm not sure I understand: the linked book is meant for high-school and college students, or anyone participating regularly in programming contests:

> The book is especially intended for students who want to learn algorithms and possibly participate in the International Olympiad in Informatics (IOI) or in the International Collegiate Programming Contest (ICPC). Of course, the book is also suitable for anybody else interested in competitive programming.

Anyone in the target audience of the book will encounter most of this frequently enough; I definitely didn't have the experience (when I was in college and doing competitive programming, over a decade ago) that I was forgetting most of it.

Of course, if someone is not interested in competitive programming and never uses any of the knowledge they're likely to eventually forget it; it's just like learning a bit of French or group theory (say) and not touching it again for years — it's possible to forget. But not sure why that's irritating; it's just the nature of learning, at least after a certain age or below a certain threshold of practice.

partycoder · 8 years ago
Not the intended audience but now, technical interviews now have a lot of competitive programming in them so this book can help you.
zawerf · 8 years ago
Same goes for most of your theoretical computer science education...

Arguably competitive programming helps with this problem by letting you drill the concepts you've learned.

ojuara · 8 years ago
Exactly
prmths · 8 years ago
Just like sql and regular expressions. You work hard to get it to work and then forget about it.
gaius · 8 years ago
That’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”.
sireat · 8 years ago
I do wonder how many 40+ programmers are able to keep up with "young ones" in these contests.

I fear it is like chess, the cognitive decline starts to become noticable in the mid 40s and only gets worse from then on.

There are a few exceptions like Korchnoi was in chess so there must be Fabrice Bellards and Bill Joys who would be able to keep up.

Still looking at completion times for Advent of Code made me feel old.

hkon · 8 years ago
I think also the interviewer gets to feel smart. Always nice to have the answers.
harshgupta · 8 years ago
I think its more of aptitude test in a domain common to all programmers.
tedmiston · 8 years ago
That's enlightening. Never thought of it that way.
fjsolwmv · 8 years ago
Maybe it's just a way to provide a fair test that anyone with ability can pass with a little practice?
yodsanklai · 8 years ago
I 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 · 8 years 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 · 8 years 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?

RedGreenCode · 8 years ago
Most 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), 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.

smnscu · 8 years ago
This 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-Ha...

2 - https://drive.google.com/open?id=1WjXxbdle0_Syip_LygBpnZkfHv...

joshvm · 8 years ago
I 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.

qntty · 8 years ago
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?
blocked_again · 8 years ago
Yup. Check out TopCoder[1]. They have regular programming contests every week or so. The contests are conducted in two divisions(amateur - div 2) and (pro - div 1) and candidates are assigned different colors on the basis of their performance. Becoming a red coder in TopCoder is a pretty big thing in the competitive programming community. For example, Adam D Angelo who is the co-founder of Quora used to be Red on Topcoder[2]. Most of the red coders of TopCoder get hired by companies like Google, Facebook etc. It's pretty hard for one to fuck up a competitive programming interview once you became a Red level candidate in TopCoder. Mark Zuckerberg also tried TopCoder for a few months while in Harvard [3]. CodeForces[4] also has a pretty big online community. I think it has become more popular than TopCoder these days. They also have regular contests every few days. Facebook[5] and Google[6] also hosts competitive programming contests every year. If you managed to make it to the final round I think they would invite you for an interview.

1 https://www.topcoder.com/

2 https://www.topcoder.com/members/dangelo/

3 https://www.topcoder.com/members/mzuckerberg

4 http://codeforces.com

5 https://www.facebook.com/hackercup/

6 https://code.google.com/codejam/

umbs · 8 years ago
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 performance (at least at Google) [1]. I wonder why, then, companies still continue to do this style of interviews.

[1] https://www.youtube.com/watch?v=DdmyUZCl75s

chillee · 8 years ago
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.

Deleted Comment

indescions_2018 · 8 years ago
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.

sireat · 8 years ago
Interesting problem.

I imagine the juicy part is that there is no clear cut formula for determining the rotation from the area needed.

Thus the task is to come up with a fast approximation algorithm to work backwards.

So brute force way:

  If area_needed > area_cast:
    rotate_cube(delta)
    delta=/2
  else similar rotation on -delta
Now, my 3d geometry is rusty, so maybe rotation on 2 axis is enough but still optimizing 2 arguments is not going to be easy. Maybe you can max one rotation then max 2nd one.

JHonaker · 8 years ago
My first instinct says that if you just project the corners straight down (because of orthographic projection) onto the XZ plane, then the area of the shadow is just the area of the convex hull of those projected points.

I don’t know how to calculate that hull off the top of my head, but that’s the type of stuff you can look up during real world scenarios.

munchor · 8 years ago
I participated while in high school and university and kept having fun on Codeforces[1]. It's a great community with very frequent tournaments and they always have detailed explanations of the expected solutions after the tournaments.

[1]: codeforces.com

dominotw · 8 years ago
Yes they are called job interviews these days :d
NetOpWibby · 8 years ago
LOL
jpamata · 8 years ago
Google Code Jam
donttrack · 8 years ago
I would watch programming contests live streams.. Are there any available?
descrip · 8 years ago
Petr usually posts screencasts on Youtube: https://www.youtube.com/user/petrmitrichev
joshvm · 8 years ago
https://www.reddit.com/r/WatchPeopleCode/

There was a HN discussion recently about programming livestreams.

saagarjha · 8 years ago
In 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 · 8 years ago
I 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
tedmiston · 8 years ago
Not sure if that's a thing but I've heard of developers streaming their screen on nights and weekends on something like Twitch.
letslightafire · 8 years ago
twitch.tv/devwars is a great competition. 3 vs 3 and you have an hour to make a better website than your competitor.
partycoder · 8 years ago
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.

partycoder · 8 years ago
There 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.
dang · 8 years ago