How would you answer the interview question, “If you had a problem with a coworker, how would you handle it?”?

This sounds like a memorized answer though and is not very convincing. When answering hypothetical questions, it is much better to convert them to behavioural questions. Recall a situation

This is a hypothetical question. Hypothetical questions do not have great validity in job interviews, but some employers still use them.

One option is to give a general answer, such as:

"I would approach my coworker directly. I would explain the problem and how it is affecting me. I would also be open to hearing their perspective on the situation."

This sounds like a memorized answer though and is not very convincing. When answering hypothetical questions, it is much better to convert them to behavioural questions. Recall a situation when you had a real problem with one of your coworkers that you resolved successfully, and describe how you handled it. For example, you could say:

"Actually, I remember that some time ago, I had the following problem with one of my colleagues:... And this is how I handled it:..."