If you have over slept and was drowsy because of this, would coffee give you an effective boost to get your day started or would you be better off with something like a sugary soda?
Coffee is an excellent countermeasure against drowsiness in general. The main and best understood mechanism of action of caffeine is that it blocks the receptors of adenosine in your brain. Adenosine is responsible for the feeling of drowsiness. It accumulates throughout the day and would act to make you feel increasingly tired. In addition caffeine likely has effects on your dopamine, serotonin and noradrenaline levels. They are all chemicals considered to be excitatory neurotransmitters. Nehlig et al. (1992) made an extensive review of the action mechanisms of caffeine. A more recent review was published by MacLellan et al. (2016).
Drowsiness from oversleeping occasionally probably stems from a disruption of your cycadian rhythm. If you wake up in the middle of a sleep cycle before completing it, you will feel groggy and tired. Caffeine will certainly have some effect through the stimulation of your central nervous system and the increased release of stimulating neurotransmitters. But so would a morning work out or a walk in the sun. Which one is more effective for you, you will have to trial and error. I'd combine them I guess.
Chronic oversleeping however should be considered a medical issue. Hypersomnia could be a symptom for many other, more serious issues ranging from sleep apnea to depression and other neurological diseases. In these cases caffeine might have positive or negative effects. But that is a question you should ask to your physicians.
McLellan, T. M., Caldwell, J. A., & Lieberman, H. R. (2016). A review of caffeine’s effects on cognitive, physical and occupational performance. Neuroscience & Biobehavioral Reviews, 71, 294-312.
Nehlig, A., Daval, J. L., & Debry, G. (1992). Caffeine and the central nervous system: mechanisms of action, biochemical, metabolic and psychostimulant effects. Brain Research Reviews, 17(2), 139-170.