Both are true.
It depends on the situation and meaning.
Where did you work before you worked here? means you are no longer working here.
So, you worked here in the past and in another place before "here" which we do not know where it was.
People tend to make that mistake and use past tense in that case but present tense should be the correct one when you know that the person is still an employee here.
Where did you work before you work here? means that you continue working here now at the present time.
Let's invert the question.
Before you worked here.. (you don't work here any more)
(you worked here, but before? Past action, completely finished.
Before you work here... you are currently working here. Present
( you work here/ you are working here, but before? Present action
A suggestion to avoid that confusion if you are speaking
Where did you work before working here?
In this case you say it right, and we assume that you are asking someone who is still working here.(but it is not clear)
If you have to choose the right answer, you need more information before you can decide...
I hope I could help you.