Your comment is very interesting! If you read OP's question, you will see a general question about teamwork. Nothing was said about working with nurse practitioners, so it's interesting that so many commenters saw that as a question about allied care providers. That question seems to have been something of a Rorchach test. I have noted a great deal of hostility towards NPs and PAs on these forums, and in my opinion it's unwarranted.
NPs and PAs are not in competition with physicians. They are HIRED by physicians. And when you go into private practice, you too will hire one, or two, or more to work in your offices. Why? Because if you are successful, one day you will find that your schedule is full, and in order to see more patients, you will have to either add another dermatologist to your practice, which will eventually only marginally help you financially by sharing expenses, or you could hire and train a NP or PA. Then, you will see the patients on their initial visits, and then, for the follow ups, the NP will see the acne, the rosacea, the hives, the eczema, etc. You will double your gross income, but your extra expense will only be the NP salary and some overhead. The NP won't have your depth of knowledge or experience, but will eventually be able to take care of the routine problems as well as you can. You will teach them what they need to know, and you will supervise them accordingly. The same thing happens in the hospital. The hospital hires PAs to be, essentially, permanent residents. They are there because the doctors want them to be there.
My department was recenetly given the option of hiring either one new physisican or two PAs. They voted unanimously for the PAs.
Now, I don't know what your exact experiences have been, or what the NPs in your hospital are like, but the NPs and PAs that I work with are knowledgable and delightful people. They know what they know, and they know their limits. The PAs in my department are all wonderful. Otherwise, we wouldn't have hired them , and we wouldn't keep them. Perhaps things are different where you are, or perhaps the cocky and obnoxious behavior is coming from the med students and residents. Medical students know nothing about patient care, and residents early in their training, know little more. So, as a student and PGY 1 and 2, it is likely that the specialty specific NPs and PAs ( and nurses and medical assistants, for that matter ) do know more that the residents, and it is a wise resident who will learn from them. Later, when you know more, you can teach them. But in my experience, if you show them appropriate respect, you will benefit a great deal in many ways. Don't compete with them. Learn from them and teach them.