My first mistake was taking the whole thing lightly. I'm a great C++ programmer (if I say so myself) so I was confident in my ability to code. However, there is more to passing a Codility test than writing good/great code. 1) you have to understand the interface, 2) you have to code an efficient solution, as opposed to a simple one that works, and 3) you have to do it in a limited amount of time. Oh, and 4) you have to pay attention to boundary conditions.
1) To understand the interface, Codility recommend you take their sample test. This is good advice which I did not take. The interface is just fine, but it does take a few minutes to acclimate to it, especially the means of entering and running test cases. In particular, they allow you to run any test cases you want, but they do not tell you whether the tests get the right answer, only whether they compile and run. This isn't immediately obvious, and it's important.
2) Codility specify the O-notation of the expected best solutions. Most of their algorithmic problems are pretty simple, but coming up with a most efficient solution may require tricks. It's a mistake to go after a tricky / efficient solution first, however, as I found to my chagrin. As I note below, code a simple solution that works first, then develop optimizations.
3) You are typically given 30 minutes to complete a test (I was given 90 minutes to complete three). This is plenty of time to code and test a simple algorithm. However, it is not plenty of time if you spend a lot of it learning the interface and investigating interesting optimal solutions. Plan your time wisely. Out of 30 minutes I suggest 10 minutes for a bolt dumb solution, 5 minutes creating a wide variety of test cases, and 15 minutes for optimization.
4) In many of their tests (I have now taken six) Codility specify boundaries like "integer in the range -2,147,483,647 ... +2,147,483,647. You will recognize these are the max values for a 32-bit int. They will give you these values in a test case. If you want to add 1 to such an int, you'll need a long long. This sort of stuff doesn't often come up in everyday coding, but you need to be ready for it.
My suggestions for anyone taking a Codility -type test:
A final comment: In Googling I found quite a few people online have commented that this type of test is a bad measure of programming ability. Okay, I agree it isn't perfect, and of course you will want other data points before hiring someone. But it's a pretty good screen; ideally a good programmer would pass such a test, easily (*ahem*), and the fact that they've taken the time to do so is an indication of their sincere interest in your opportunity.
Cheers, and happy testing!