For is a preposition.
It is considered bad style to put a preposition at the end of a sentence.
So a more grammatically-correct sentence would be: "For which company do you work?"
However in normal usage in the UK, most people will tend to use "Which company did you work for?".
But then, most people won't know what a preposition is.