"Si sentiva" is the imperfetto (one of our tenses used to express the past) of the reflexive verb "sentirsi". The subject of the sentence is "he" or "she", 3° pers. sing.
"Come un esame" wouldn't be correct in this context. If I say "Mi sentivo come XX..." this means "I feel as if I were XX", i.e. "I equate myself with XX", I express the idea that I am actually having the feeling that "I am XX". Es. Mi sentivo un re. = I felt like a king. I felt as if I were a king.
"Come a un esame" is correct here, and it means "S/he felt as if he was sitting an exam". The preposition "a" in "a un esame" conveys the sense of "SITTING an exam". S/he did not feel as if s/he was an exam him/her/himself (that would be a nonsense); rather, s/he felt as if s/he was sitting an exam (=S/he felt nervous and maybe under scrutiny).
Hope this helps! :)