“It’s a challenge, but it’s what I signed up for,” Ms. Spanberger said in an interview after the town hall. She made a point of thanking her more critical questioners, including Dale Swanson, a founder of the local conservative women’s coalition, for their presence and their questions.

“If you’re only walking into comfortable spaces and comfortable rooms,” she added, “you’re probably not doing your job.”

But Ms. Spanberger said she has had conversations with colleagues in more solid blue districts about the impact of both hard-line liberal policy and the tone of opposition, which have prompted her to emphasize in town halls, sometimes unprompted, that she is “absolutely not a socialist.”

“When people say things in snarky ways or disrespectful ways or flippant ways, that creates an issue in districts like ours,” she said. “It’s real easy to be kind of snarky in the majority.”

At a pair of town halls last week in the deeply Republican suburbs of Salt Lake City, Mr. McAdams, an affable and mild-mannered former Salt Lake County mayor, fielded pointed questions about whether he supports the Green New Deal and socialism. More broadly, constituents worried how their moderate congressman might fare in the same caucus as the liberal bomb throwers. Richard Hansen, a Republican county commissioner and one of the two dozen constituents who attended the town hall in Nephi, a mountain town of 6,000, shared a wish with the Utah Democrat: “I hope they don’t corrupt you.”

“They won’t,” Mr. McAdams pledged. “There have been some articles about this, a little bit of tension on the Democratic side: Are we going to veer to the far left or are we going to stay in the center? I don’t know where the Democratic Party will go, but I tell you what, I will stay in the center. People are going to have to take it or leave it.”