if someone asks me or if there is a question in exams like "who is the author of Xxx book?" Should I answer in the past or present tense,like "Yyy is/was the author of Xxx book". I know the author is not alive.
I would stick with the present tense. The author's death doesn't change the fact that they wrote the book.
Hence "Terry Pratchett is the author of Mort". (But "Terry wrote Mort" in the past tense.)
It is not a significant point, and using "was" doesn't affect understanding or sound unacceptable.