Whether you mostly work alone or if you work on a team, being able to get along with other people is a critical quality to have in any workplace. Most interviewers are going to try to gauge how you work with others through a question like this one.
Here are some tips on how to nail this question and leave your interviewer impressed:
Share the aspects of yourself that make you a team player. If you are social and outgoing, say so. If you are a great listener and process information well, say that.
It does not matter what type of person you are, whether extroverted or introverted. Just share the aspects of yourself that help you flourish when working with others.
Example: I am a super outgoing and social person. I have always found it easy to make friends and talk to others. I am the kind of person that can get everyone on the team to contribute in some way and make sure that everyone is comfortable.
Make it clear that in the face of conflict, you can still get work done and get along with others. Do not say that you hate conflict and always avoid it, because conflict is inevitable eventually.
It might even be better if you share some times that you have had a conflict in the workplace and handled it well. Basically, just make sure the interviewer knows that you can still work well in stressful environments.
Example: That being said, I still have had some conflict in the workplace. There was a miscommunication at my last job about who did what task, so one job was completely unfinished. Two members blamed each other for the unfinished task. I was able to handle the situation by explaining that it was a miscommunication, and they could work together to get the last part done.
Another thing to avoid is putting people down when giving past examples. Try not to portray your coworkers in a negative light. From the last case, notice the coworkers were not described as annoying or rude.
Keep things light by speaking optimistically. This shows that you can get along with everyone, no matter the problem.
A great way to answer this question is by tailoring your response to the job that you are interviewing for. If you are going to be working on a team, talk about past teams you have worked in. If you are going to be managing people, explain how you have worked in management positions before.
Share information that is relevant and specific to the job you are applying for. This way, you avoid ranting and show that you understand the job that you are applying for.
Example: I love working on a team, so I would say I get along with other people very quickly. I have been on a design team at my last two jobs and have had a lot of experience working as a team player. Collaboration and synthesizing information are two of my most prominent skills, and I look forward to using them here.