From a quick Google it seems that this is possible at least in an alternating fashion, but I'm curious about whether both symptoms can occur simultaneously. For example, a hard difficult-to-pass stool accompanied by liquid. If so, what conditions make this possible?
Yes, constipation and diarrhea can occur simultaneously - the situation is called paradoxical or overflow diarrhea.
Paradoxical diarrhea or overflow incontinence may occur is a a person who has chronic constipation. In paradoxical diarrhea, stool fills the rectum, hardens and becomes impacted. Liquid stool leaks around the fecal mass, imitating incontinence. (MedicineNet)
First, severe constipation (fecal impaction) with formation of a hard fecal mass develops in the rectum or higher in the colon. Later, when the new liquid feces reaches the hard fecal mass, it passes around it and (because the colon has been irritated for some time due to impaction) is quickly excreted as diarrhea.
Causes of chronic constipation that can lead to fecal impaction:
- Diet low in fiber
- Medications: certain antidepressants, antihistamines, antacids, opiates and iron supplements
- Constipation-predominant irritable bowel syndrome
- Diseases: diabetes mellitus, Parkinson's disease, multiple sclerosis, spinal injury, Hirschsprung's disease
- Structural abnormalities of the colon, for example, in diverticulitis, Crohn's disease or colon cancer
- Instrinsic neurological intestinal problems: slow transit constipation, anismus
Source: Evaluation and Treatment of Constipation and Fecal Impaction in Adults (Mayo Clinic Proceedings, 1998) - an article intended for doctors, but simple to read and informative for anyone.
As suggested in the question, constipation and diarrhea may sometimes only appear to be simultaneous, but in fact, they are alternating - in this case, the problem is not in fecal impaction.