Student or Learner
Generally prepositions go at the end of the questions but there are some of them which actually start with prepositions, why is that possible? For instance:
'At what time do you come home?'
'In which month we are?'
At one time in the past, a 'rule was invented that a preposition was something you couldn't end a sentence with. - It would have been necessary to reword that sentence as: At one time in the past, a 'rule' was invented that a preposition was something with which youc ould not end a sentence.
That 'rule' is now largely ignored, especially in informal conversation. However, in formal writing, some people still obseerve it - which is why your sentences are correct.