Your first example is the usual form, though in AmE you're likely to come across your second example quite often.
Subordinate clauses like the ones I've underlined in your examples are called Interrogative Content Clauses (aka indirect questions). They can be glossed with the formula "the answer to the question". And the order can be inverted:
"May I know the answer to the question 'whose pencil is this?'" (uninverted order)
"May I know the answer to the question 'whose pencil this is?'" (inverted order)