A microorganism has to adapt to changing environmental conditions in order to survive. Cells could follow one of two basic strategies to address such environmental fluctuations. On the one hand, cells could anticipate a fluctuating environment by spontaneously generating a phenotypically diverse population of cells, with each subpopulation exhibiting different capacities to flourish in the different conditions. Alternatively, cells could sense changes in the surrounding conditions - such as temperature, nutritional availability or the presence of other individuals - and modify their behavior to provide an appropriate response to that information. As we describe, examples of both strategies abound among different microorganisms. Moreover, successful application of either strategy requires a level of memory and information processing that has not been normally associated with single cells, suggesting that such organisms do in fact have the capacity to 'think'.