So, I was thinking earlier today and I came up with this idea of how deja vu works. Every night, you dream three or four times throughout your sleep cycle. Scientists explain dreams as your mind trying to make sense of random neural firings. What I think is that since you dream about things and places you are familiar with or have thought a lot about recently, dreams might be your mind simulating different possible scenarios. Occasionally, your mind will guess correctly, and that is deja vu.
At least when I have had deja vu, it seems to be about rather inconsequential things or common situations. It seems perfectly likely that given the sheer number of dreams people have that a few of these experiences might actually happen in real life.