The country’s major news organizations, as surprised as anybody by Donald J. Trump’s ascension to the presidency, faced a question from their audiences on Wednesday that was laced with a sense of betrayal and anger: How did you get it so wrong?

The question came in letters. (“To editors and writers of The NYT,” one reader wrote, “you were so wrong for so long. You misled your readers and were blinded by your own journalistic bigotry.”) It came in Facebook posts. (“You were in a bubble and weren’t paying attention to your fellow Americans,” the filmmaker Michael Moore wrote in a post shared more than 100,000 times.) Most ominously, it came in the form of canceled subscriptions, something that will surely be monitored.

After projecting a relatively easy victory for Hillary Clinton with all the certainty of a calculus solution, news outlets like The New York Times, The Huffington Post and the major networks scrambled to provide candid answers.

With a new administration about to take shape in Washington, news executives tried to take stock of their mistakes and fix them on the fly, lest the fast-moving story leave them behind again.