Google Code Jam 2015
code.google.com
code.google.com
It's a humbling experience for anyone who thinks he or she is a good programmer. I remember when I tried topcoder for the first time. I thought it would be easy to move through the ranks and it turned out to be much harder than expected.
However, it's an extremely specific type of programming that in my opinion don't reflect real life programming aptitudes.
I think I learned two important lessons though. Be confident your solution is correct before starting coding it, and don't debug but write correct programs instead. It's easier said than done, but a little discipline can help a lot.
1. Raw coding skills - You'll reach a point where what's in your mind can be coded with very few stupid low level coding bugs like syntax errors, mis-assignments, initialization errors and such. Obviously this doesn't help with higher level issues like program design etc..
2. Algorithmic skills - You'll get VERY good at analyzing algorithmic complexity. You'll thoroughly understand common data structures like lists, vectors, trees, hash maps and other common algorithms.
Both these things are very much relevant to real life programming.
I eliminated all basic issues in my coding skills a few years ago by doing a lot of online challenges.
Drawing an analogy to writers, online challenges (or preparing for them) is like getting really good at sentence formation, vocabulary, paragraph formation, etc. This allows you to then focus on larger things like writing a paper and even comprehending other people's papers with much ease.
Code is the language of software engineering and computer science. Online competitions help internalize that so that it becomes second nature.
> The competition will challenge your distributed coding, latency reduction abilities, and of course, your algorithmic coding skills
For difficult problems you can often write a brute force solution with terrible complexity (think 2^n) for the small input set. For the large though, you'll need to really understand the problem and write an efficient solution via memoization, dynamic programming, pruning, or good (sometimes obscure) algorithm choices. For small solutions you get instant checking of your solution on submit (but not what you failed on, only that you did), for large ones you submit and hope for the best.
As for why you should care, for me at least it's fun to come up with fast solutions to problems regardless of whether they're efficient or if my code is well designed. You learn about new types of algorithms and ways of solving problems. For example, dynamic programming was foreign to me until I started doing tons of TopCoder. Google also uses it for recruiting, I'm still getting contacted by them even though I skipped last year.
My favorite moments come from solving problems poorly while knowing there's a proper solution out there. Ex: There was a problem in some competition where it was some special way you had to return the y-intercept of a line with a given slope that bisected a particular polygon. There was an actual way to do it properly, but I'm not so great at math/geometry so I ended up doing a binary search and did enough iterations to get the right amount of floating point precision they wanted.
Edit: Should also point out that since you're not in a controlled environment, you have full internet and library access unlike ICPC where you have to rely on memorization and standard libraries.
Even though I'm an outsider myself to these competitions, I found the book fascinating. Someone posted an article here at HN about someone reading Greek Classics a hundred or so times and what he got from that... this is the kind of book I feel like I'll have to read that many times in order to get the most of it!
"[...] the book contains a collection of relevant data structures, algorithms, and programming tips written for University students who want to be more competitive in [...] competitions, those who love problem solving using computer programs, and those who go for interviews in big IT-companies [...] The possible long term effect is future Computer Science researchers who are well versed in problem solving skills."
P.S.: nobody asked me but, what the hell. The other algorithms book I'm really itching to recommend is Sedgewick and Wayne's [2] :-). I like it more than other commonly recommended books, like Skienna's "Algorithms Design Manual" and Cormen's "Introduction to Algorithms".
Is it just because they can still solve a challenge even if the solution is suboptimal in some cases? It can't possibly be that it's easier for them to think about problems that way...
Another interesting thing is that Python is only really popular in US.
Source: http://www.go-hero.net/jam/14
Modern C++ is about as easy to use as Python or Ruby for algorithmic problems and has many fewer gotchas and hidden time sucks. Python tends to spend a lot of time on implicit data type conversion that C++ saves and the data structures in Python are deeply suboptimal so that many algorithms won't run in their theoretical asymptotic time. Ruby is even worse. Python and Ruby's numerical efficiency and consistency is not suitable for fast, precise, predictable computation.
Take a look at some of the solutions on go-hero and you can see the style of C++ that is used; there aren't any ugly class hierarchies and deep template metaprogramming there. Modern C++ is very simple and efficient with C++ versions of all the nice tools and gadgets that make Python and Ruby fun.
"Another interesting thing is that Python is only really popular in US"
I think Python is popular only in the USA in real life, too. Living overseas you learn that the rest of the world is very, very far behind in programming tools compared to Boston and SF.
i have always found bjarne-stroustrup's books to be quite useful. his latest one (Programming: Principles and Practice Using C++) seems to cover c++11/c++14 as well. might be worth checking out ? another author i really like is andrew-koenig, you can probably look at, Accelerated C++, from him. it is a bit dated, but still pretty good overall.
Python is more concise but it can be too slow for certain tasks, and the lack of static typing can be counterproductive.
And/Or you can forbid sleep and similar nop functions.
And/Or you can sit down and analyze the code.
Truth be told, it makes for a very boring competition, but a very useful exercise.
while(earth_has_not_blown_up) {}
"Hey, I need the earth to blow up to solve this problem!"
while True:
continue
return solve(x) sleep(10000)
return fizzbuzz(10)Yes / No
Google master troll