An uncommon question that I've come across from Agatha Christie's Nemesis reads,
In my opinion, I feel that as the action is in the past, it should have been
However, is it possible that the former is grammatically correct, as the sentence is basically
"Did you sleep well?"
but with the "Did you" omitted?