I am preparing for a programming contest where we have to code in C++ and it is all about producing working code in a short time. An example would be to use a macro to get the minimum of two ints or using memsets to initialize arrays (but I was told that you shouldn't use either here).

This leads to the question: what kind of coding techniques exist to speed up coding at a real job?

Answer: Know your STLs (13 Votes)

Review the standard libraries intensely, particularly the STL algorithms. This will save you many lines of code and a lot of time. The key to winning programming contests is in programming at as high a level as possible. In C++, without external libraries, this means STL calls instead of for loops.

Answer: Veteran advice (5 Votes)

I participate regularly in ACM competitions. Hopefully some of these tips will help you:

As others said, familiarize yourself with the language, in C++, especially the STL, it has both common functions that you'd want to use (binary_search, min, max) and robust data structures to save you time (stack to avoid straight up recursion, queue for BFS, even priority_queue for Dijkstra if you like it that way).

Identify the category of the problem, if it's mathematical / dynamic programming / graph theory etc. Ask yourself how familiar are you with it. After doing this you should make decisions regarding the order in which you'll solve them; this goes hand to hand with the next point...

You want to understand the problem completely before typing. Solve the right problem. In my first competitions I thought that if I wasn't typing, I was wasting my time. I later found that this was a mistake.

Don't think comments are a waste of time. At least in "clever" code, you don't want to go debugging line-by-line to see what went wrong (that is a real waste of time). Value clarity.