Fewer than half of the 21 candidates interviewed explicitly said that they were open to the idea, including all four female senators in the race: Ms. Warren, Kamala Harris of California, Ms. Klobuchar and Ms. Gillibrand.

“It depends on what happens with the Senate, if that’s realistic,” Ms. Klobuchar said.

Many others, including Mr. Sanders, Mr. O’Rourke and Mr. Booker, said they were against the notion. And some proposed alternate ideas to change the court.

“It’s not just about the number of justices,” said Pete Buttigieg, the mayor of South Bend, Ind., who has proposed both expanding the court and overhauling the way justices are selected.

Reversing Trump’s Policies Abroad

[See their responses on troops in Afghanistan and Israel’s record on human rights.]

On foreign policy, the Democrats appeared focused on undoing Mr. Trump’s policies and repairing the standing of the United States abroad. This was most apparent on the issue of climate, where nearly every candidate said they would aim to lead the world in addressing the crisis, reversing Mr. Trump’s approach.

Clarity and consensus were more elusive where the Middle East and Afghanistan were concerned. Some candidates — including Ms. Warren, Ms. Gillibrand and Julián Castro, the former housing secretary — said definitively that there would not be American troops in Afghanistan at the end of their first term. But many said it was possible or likely that they would leave some forces there.

“I believe that we should bring back our troops in Afghanistan,” said Ms. Harris, “but I also believe that we need to have a presence there in terms of supporting what the leaders of Afghanistan want to do in terms of having peace in that region.”

And even as liberals have grown more skeptical about the American relationship with Israel, most of the candidates expressed nuanced views about Israel’s record on human rights and the Palestinians.