Will caffiene prevent you from getting deep sleep if you are able to fall asleep?

Sleep onset. It is more likely to increase the sleep onset, in other words, it makes it harder to go to sleep. It may also make if more likely to have more light sleep which might mean less deep and rem sleep. All stimulants should be avoided to give you the best chance of good sleep.
Pissible. More often than none, stimulants like caffeine trigger difficulty falling asleep and achieving restorative rem sleep.