I had a lot of fun coding throughout my career. There are a few problems, however, that I still remember fondly as particularly fun to resolve. They weren't the hardest ones I worked on or the most important ones. However, at the time, they gave me a great satisfaction that I can still remember today.
Here are two examples:
I was working on an online advertisement system for a hosting company, back in 2000. I had a list of banners that needed to be displayed randomly anytime a web page was rendered. For each banner, I had a percentage associated with it. The percentage represented the probability of that particular banner to be shown on a website in the system.
I had to write the code to show the ads with the correct frequency. The system was getting millions of requests per day (a huge number at the time), and it had to be highly performant. I had a blast working on that problem. The solution I implemented was simple and fast (at worst O(log n)). I used variations of it over the years for different problems.
The second one is from 2003 when I was trying to optimize a virtual machine designed to run on a mobile device. Mobile devices were slow at the time. Very slow. The virtual machine was not performing well on a particular device, and I spent some time profiling it. The code was written in C++, and I realized that what was slowing things down was the memory allocation system on the device (not shocking).
Any time an object was created with "new," the allocator took too long to do its job. I decided to create my own memory allocator, highly optimized for the particular application I was running, which happened to create many very small objects. The result was an immediate 95% performance boost across the board.
There are many others, but I'll stop here. What about you? Are there problems that you remember as particularly fun to resolve? What were they?