Never, never, respond to that question with any declaration of competence. It only legitimatizes the question, and makes the woman sound defensive.
The question is designed to remind all viewers that women are handicapped in the business world; that they lose some intangible "mommy" ability when they are successful.
Has no one ever given Ms. Barra a course in handling tough questions? Isn't there a class for women dealing with unspoken stereotypes?
That said, how should she have handled the question?
First, it's a teaching moment.
We need to turn that non-question around (akin to have you stopped beating your wife).
The question we need to answer is "how did you did you manage both family and career to get where you are?"
It's a chance for her to explain how she has done so well in her career. Explain the things that are needed: family support? child care? Husband? What about her early years: what has changed. How her kids adapted to her career as they got older.
Second, it's a promo moment.
She has a chance here to showcase her skills and the skills of her family (in which she probably had a big influence).
She should have played up her children's response: they made it clear that they have high standards for her and by implication she has met them in the past.
Women need to be aware that they are "on camera" at all times and need to reframe the question, not answer it.