Making a killing on initial public offerings used to be easy.

At the peak of the technology boom, little more than a decade ago, a plentiful supply of companies vied to sell stock on the exchanges, and investors were assured mouthwatering returns.