I'll start with an example, which is admittedly lame, since I have never been a professional programmer. This was for a college group assignment. The assignment was to search for a particular word in the manual pages of Linux, and do it with a faster run time than the man -k program (there was a bit more to it but that was the gist of it). Trawling through the pages proved far too slow, so the only solution was some kind of indexing system. The one I thought of was this: Create two text files. The first being a list of the manual pages in Linux, one per line. The second being a list of the words in manual programs, one per line, with the line numbers of the manual pages they appear in, as listed in the first file, listed on the same line. (An objection raised to this was that the line length of lines containing common words like "the" would be too long, so we were stymied for a while. But we were then advised that line lengths in a text file were arbitrary. Who knew?)
When the program was called it would simply trawl down the second file for the appropriate word and then print the lines of the first file corresponding to the numbers on the line to the screen. This method seems obvious in hindsight, but our program had the fastest runtime, took up the least disk space and had the least code of the entire class. I guess it takes a genius like me to think of the obvious.
