Both of the sentences are grammatically correct and convey the same meaning. The difference is only in the placement of "user's" and "a user."

Another way to formulate the question could be:

"What is the best way to categorize answers into predefined categories given by users?"

This phrasing removes the possessive form and specifies the context in which the answers are given (by users). It also emphasizes the importance of finding the most effective approach to categorization.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence