I think you confused with the usage of '吗‘. Usually, 吗 is used at the end of a 'yes or no' question. For example the second sentence. 你有什么爱好吗?might be used in the context that a person looks very boring and seems she or he was not interested in anything. The other person may ask 'Do you have any hobbies? '. The reply should be 'yes or no'. However, without 吗, it is a specific question to ask 'what are your hobbies'. Hopefully it would be helpful.