There were no questions on immigration or climate change during Tuesday’s Democratic presidential debate. But there was one about Ellen DeGeneres.

Anderson Cooper’s query about surprising friendships and what the candidates had learned from them — inspired by controversy over the talk show host’s relationship with former president George W. Bush — quickly drew ridicule.

Tommy Vietor, a former Obama spokesman, tweeted in all caps to express his disbelief: “NO. NO YOU ARE NOT CLOSING WITH AN ELLEN QUESTION.” Margaret Sullivan, a media critic for The Washington Post, called it both “cringe-inducing” and “flat-out embarrassing.”

Even one of the candidates got in on the criticism.

“We keep leaving some of these huge issues that impact families off of the question agenda at these debates,” former housing and urban development secretary Julián Castro told MSNBC’s Chris Hayes. “And really, it’s journalistic malpractice to do that.”

Representatives for CNN and the New York Times, the debate’s co-hosts, did not respond to inquiries about how or why they chose a question that sounds more like a college essay prompt than presidential debate fodder.

But moderators are generally given wide latitude to determine what candidates will be asked. And the “unexpected personal question” is starting to become a debate staple, said Alan Schroeder, a journalism professor at Northeastern University and author of “Presidential Debates: Fifty Years of High-Risk TV.”

“The idea is to come up with a topic for which the candidates do not have a prepared response, something that throws them off their stump speeches and requires them to respond spontaneously,” Schroeder wrote in an email. “That would have been the reasoning behind the ‘unexpected friend’ question last night.”

Similar inquiries include an infamous example from 2016 in which Donald Trump and Hillary Clinton were asked to “name one positive thing” about each other. Over the years, this type of question has occasionally elicited “fascinating responses,” Schroeder said. He cited the “insightful” answers that George W. Bush and John Kerry provided in 2004, when a moderator pointed out that both Bush and Kerry had strong wives and daughters and asked what they’d learned from the women in their lives.

In another example, Dan Quayle and Lloyd Bentsen were asked during the 1988 vice presidential debate to name a book or film that had influenced them. Quayle’s response, Schroder said, “seemed particularly contrived and, therefore, unbelievable.”

“Sometimes debaters are asked questions that seem to come out of left field but that end up revealing valuable info about the candidates,” he said.

That wasn’t the case this time, experts agreed. It came too late in the three-hour debate, said Aaron Kall, director of debate at the University of Michigan, and because all 12 candidates were asked the same thing, it opened the door for repetition.

Ultimately, several candidates didn’t name anyone. Entrepreneur Andrew Yang talked about a trucker and former Trump supporter named Fred. Sen. Amy Klobuchar (D-Minn.), Sen. Bernie Sanders (I-Vt.) and former vice president Joe Biden all had the same answer: the late senator John McCain.

“I think that the question could have been improved if the moderators would have said in advance, ‘No candidates are allowed to use the same answer,’” Kall said. “That would have forced a variety of people to go deeper into it, not repeat McCain.”

Much of the criticism centered on the idea that friendship talk took up time that could have been devoted to more important topics.

Yet, as The Post reported Wednesday, analysis suggests this year’s Democratic debates have for the most part focused on topics that matter to voters, such as health care.

Kall said unexpected, personality-type inquiries can hold value for some voters, who might be interested to see how candidates react to a question they haven’t practiced for in their hours of debate prep. Others might want to know that a candidate is willing to reach across the aisle. The Ellen question, had it been more successful, could have done both.

“There’s value, but also there’s an opportunity cost,” Kall said. “This was 15 minutes that could have been spent somewhere else. Would that have been more valuable and informative to the viewers? I guess we don’t really know.”

Read more: