Just a few days ago I discovered Codility, and I tried their challenges. And I must say. I got my behind handed to me on a platter. I'm not sure what the problem was, but I'll lick my wounds and wait for the solution to come out and compare it with my own. In the meantime, I want to get ready for the next challenge so I'm reading their previous blog posts and seeing how to solve their previous problems. There are a lot of new things I haven't heard about like (Cartesian trees, various sort algorithms, etc.)

So, how does one prepare for such challenges (especially the O(x) time and space complexity). What should I read to prepare for such a task?

  • I've been studying haskell lately partly to force my brain to contort (it will force this) specifically to help become more nimble in thinking up solutions. That said, I'm also reading The Algorithm Design Manual (free online pdf exists) and a garage sale copy of The Art of Computer Programming Vol 1 Fundamental Algorithms by Knuth (which is also a serious source of brain pain) for the same purpose. – Jimmy Hoffa Oct 5 '12 at 15:11

how does one prepare for such challenges (especially the O(x) time and space complexity). What should I read to prepare for such a task?

By getting prepared of course ! It is a matter of practice and getting up to speed about areas that you have felt short. Thanks God, pretty good resources to cover once information shortcomings are on the internet and Google is your friend.

Regarding references i would advice several web-sited that do have programmer challenge questions. From that question types you can determine your shortcomings and study for them.

Resources to look:


The only thing that you can do to prepare yourself for such kind of tests is practice. Practice a lot. There are a lot of good resouces for coders help, such as topcoder, codegolf, geeks for geeks, Programming Praxies, CodeKata, Project Euler etc.

If you are having problems with data structures, it would be better that you brush up your algorithm and data structure concepts. Best Place for that is wikipedia, but you can also look for algo data courses on nptel, coursera, etc...

  • I was looking more for resources like books, but some of your links have been new and informative. – Daniel Fath Oct 5 '12 at 8:34
  • 1
    @DanielFath: Reading about it helps, but problem solving is an art that has to be practiced if you want to become good at it. In the world of writing software, there is a surprisingly large number of of problems you'll see repeatedly. The experience of having solved them before gives you the ability to spot new variations and quickly apply a good solution. – Blrfl Oct 5 '12 at 12:04
  • I agree with practice a lot part, I'm merely expressing desire for more concrete resources, in order to consider the question solved. I upvoted the answers (heck I've upvoted all of them). – Daniel Fath Oct 5 '12 at 13:42

The semi-official blog posts about Google recruitement recommands this book: The Algorithm Design Manual.

It's very comprehensive and well written, with a 'quick reference' part that can help a lot in your situation, once you're familiar enough with common algorithms and data structures.

Not the answer you're looking for? Browse other questions tagged or ask your own question.