In Yes/No questions the pitch quickly goes up on the first stressed syllable, then gradually goes down, then raises considerably on the last post-tonic syllables.
Wh-questions are made by a similar pattern: the pitch suddenly moves up on the question word (it always bears an accent mark), then the pitch gradually goes down. Unlike Yes/No questions, the pitch does not go up at the end of the sentence. The same is true for exclamations.
Remember that Spanish has special symbols to mark the beginning of a question or an exclamation: ¿ and ¡ They must not go at the beginning of the phrase:
Y tu amiga, ¿viene?
Estudiar español ¡es fantástico!