This is a really softball question. I mean, who is going to say "oh dear, I'm afraid I don't get along with other people at all" in an interview? An ideal answer:
- agrees that getting along with the coworker is more important than technical skills, working environment preferences, and whatever else was discussed in the interview (which seems odd to me, but is what the interviewer said.)
- states firmly that you're confident you will get along with the coworker
- ideally, backs that up with something specific about the coworker (surely this person said something in the interview up to this point, or something was said about them)
- in the absence of some trait in the coworker you can use as proof of your confidence in the getting along, provides a one or two sentence elaboration of your general get-along-itude.
Yes, I think when you have a small team like [name] and I would be, being a true team and sharing the effort and knowledge is key to success. I know we could work together like that. We have a similar approach to [something coworker asked about] and our backgrounds complement each other well. [Name], if you'll backstop me on [something coworker is clearly good at] I have your back on [something you know you're great at and were asked a lot if you were good at, so you know they need it.]
Yes, I think when you have a small team like [name] and I would be, being a true team and sharing the effort and knowledge is key to success. It's important on large teams too though it can be a challenge there with so many different workstyles and personalities. I've had great working rapport with [name three or four job titles, like "DBAs, sysadmins, testers, and other developers" or "plumbers, architects, landscapers and interior designers"] and with people who were very detail oriented and finicky all the way to free spirits who felt process was for everyone else. Getting along is important to me and I always find a way to do it.
Then smile - the interviewer has handed you an easy question and you haven't thrown it back at him because you can't predict if the guy next to you is someone you can get along with or not. Nor have you argued with the interviewer or corrected the question. In this way you're actually showing you can get along with people.
One other warning. Some interviewers may be reverse psyching you here. They might expect:
Sure, getting along is important, and I get along with just about everybody I've ever worked with, but the most important thing is [shipping software, making clients happy, contributing to the profits of the company, curing babies of cancer, building schools] and I never forget that. I enjoy my work a lot, which makes me easy to get along with. That said, my integrity won't let me gloss over shortcomings or problems even if discussing them can get a little uncomfortable. I'm not rigid and I don't always insist on building a Cadillac with a Kia budget, don't get me wrong. I'm just saying that getting along can't always be the most important thing, even though it's something I'm really good at.
If you think you might ever need an answer like this, work on it in advance a little. It's easy to wander over the rails and look like that guy who doesn't care about budget and does what he wants because it's right, or holds up urgent fixes for days refusing to implement a workaround, or reports coworkers for spending too long in the bathroom. I'd rather take the question at face value myself. I'm just alerting you that the interviewer may not be saying what they appear to be saying.