Also as an FYI: there is a "pointer" left in the residency forum. That's how I got here.
You will likely get more answers and responses if you are gracious about what answers you get. If you are whiny, argumentative, or arrogant you are likely to not get many responses, or responses that are not helpful. Things to consider. Also something to remember in the future should you ever get into medical school (and residency).
That being said, I will answer your question. You won't like it.
It depends where you are. I am at a program which has more teamwork players. Whether residents work well together or are gunners depends on the residents. Of course there are always residents who will occasionally (or not so occasionally) throw another resident under the bus and try to make them look bad. You can only interview wisely and hope you choose wisely to get a program that isn't full of those residents.
As for attendings playing favorites, that again depends on the resident more than anything. Attendings are people (yes, they really are!) and in that way they will get along with some residents better than others. That being set aside, whether attendings play favorites depends on whether you are a team player, an arrogant jerk, an idiot, a slacker, a hardworker, immature, intellectual, social, etc. If you're an arrogant slacking ***** who just wants to "get by" and do as little work as possible, your attending will likely make your life difficult. If you work hard, read about things you find you are lacking in, have some sort of social graces, and show the ability to be a strong team player your attending is more likely to treat you favorably.
That all being said, there are definitely malignant residencies out there. I would try to avoid those at all costs. And they tend to change, so no I can't tell you what if any residency programs will be malignant if you ever get to the point of residency interviews.