"Are you a doctor, ma'am?"
Translation:هَل أَنْتِ دُكْتورة يا أُسْتاذة؟
Well, in this case it depends on what the person asking wants to know ...
Are you a (female) medical doctor? هَل أَنْتِ طَبِيبَة؟
Are you a doctor (do you hold a PhD)? هَل أَنْتِ دُكْتورة؟
As in this case the person being asked is called أُسْتاذة (female professor) the conversation is probably taking place in an academic context, so the translation "doctor" seems to be acceptable. دُكْتور/دُكْتورة is also being used sometimes in spoken language when referring to a medical doctor.
I am more worrying about the translation "ma'am" for يا أُسْتاذة ... Sounds weird to me.