The "what are your weaknesses?" question has been a cliche for decades. There are far better questions to ask, but you can answer it successfully if you understand what the interviewer really expects as an answer.
I think @Notvonkaiser's answer is right on, here's another thing to think about...
Keep in mind is that you must not merely "list" weaknesses even if that's what the question is literally asking. If you just list the weaknesses without any context, the interviewer will then choose which one they want to follow-up on with a line of questioning that you can't necessarily predict and which may go down a path that makes you look bad.
Instead, gently shift the control in the situation by immediately giving a narrative of a past work-related incident in relation to something that is a weakness. By launching into the narrative, you can instantly add authenticity to what you're saying (because it actually happened). It also gives you the opportunity to describe how your shortcoming was resolved. Generally speaking, the interviewer wants to assess whether you have the ability to realize and admit when you're wrong, that you can graciously accept criticism and help from others, that you can reflect-on and learn-from failure(*). All of these things are valuable in a workplace.
That said, the most skilled interviewers will use "behavioral interview" techniques that can fish out answers to such concerns more effectively and smoothly. If you you're not dealing with a skilled interviewer, then it becomes your job to compensate for that by answering your questions strategically and with authenticity. Not easy, but it can be done with practice.
(*) There are "old-school" interviewers who may genuinely ask this question because they want to see if you name a weakness that is a no-go for the position. That's rare, but if it happens the advice given here will be overkill but it will work.