1. Did you lock the keys in the car?

2. Did you lock the doors in the car?
------------------
Are they grammatical?

Yes.