From a part of speech perspective, you'll be interested in the the tags that begin with "W" found here: https://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html
However, the PoS tags won't be enough. Consder a sentence like,
- Bob is the person who ate the cake.
The sentence isn't interrogative but the "who" will trigger the PoS logic. Hence, you might use a dependency model to look at how the word is used grammatically. Enter the same sentence into this: http://corenlp.run/ and look at the 'enhanced ++ dependencies". You'll notice that "who" has an arrow back to "person" (these are adjective clauses introduced by relative pronouns; you can skip over these).
There are other cases like:
- When the cake was gone, I was sad.
Again, the PoS logic will trigger, but you can add some code to see if the phrase modifies the verb. If it does, then it's likely an adverbial phrase (and can be skipped).
Note that many question words will follow a preposition:
- For what reason did XXX ...
Finally, there are the yes/no and tag questions. These use auxiliary/modal verbs:
- Is Tom smart?
- Does Bob eat pizza?
- Can (could/would/should) Sue go to the beach?
- Bob ate the pizza, didn't he?
(within the clause, no subject precedes the aux verb)