A novice politician hailing from the New York borough of Queens gains enormous media attention and a huge and wildly passionate following in part by lobbing irregular critiques at the news media.

Donald Trump in 2015? Yes. But also Alexandria Ocasio-Cortez, circa 2019.

Their backgrounds, gender and — especially — their politics are different, but the Republican president and the outspoken freshman Democratic congresswoman from New York share at least one similarity: Neither has been shy about using social media to pummel the press. And like Trump, Ocasio-Cortez has been cheered on by millions of followers when she does so.

Ocasio-Cortez has squared off on Twitter against such varied media outlets as the New York Post, The Washington Post, Politico, the Hill newspaper, CBS News, Fox News and Glenn Beck’s BlazeTV for statements she deemed offensive, inaccurate or just tone-deaf. And that was just in her first two weeks as a member of Congress.

On Oct. 31, 2018, then-President Trump baselessly claimed that "33 percent of the people" in the country believe the media is the "enemy of the people." (The Washington Post)

But there is one big difference: ­Ocasio-Cortez seems to respect the role of the news media, even as she criticizes it. Her jeremiads tend to be surgical rather than the blunt attacks that Trump has aimed at the mainstream media. To date, she hasn’t described journalists as “the enemy of the American people.”

On the other hand, she has banned reporters from covering her, just as Trump has. But the congresswoman has on occasion doled out praise to the media, something nearly unthinkable with Trump. “Public radio is great!” she tweeted late last month. “As is @ProPublica, @frontlinepbs & a great deal of other incredible outlets worth our support.”

Journalists probably liked this, too: “The biggest threats to journalism right now are tech monopolies & concentration of ownership,” she tweeted after BuzzFeed, HuffPost and other news organizations announced layoffs. “Healthy democracy *requires* high-quality journalism.”

But Ocasio-Cortez, like Trump, is pugnacious in the face of perceived slights by news organizations. After she criticized CBS News’s hiring practices, National Journal Political Editor Josh Kraushaar tweeted that Ocasio-Cortez shared Trump’s habit of being a “media scold.” She let him have it with a mini-lecture on Twitter about race, concluding, “It’s not about ‘quotas.’ It’s about understanding the country you’re living in.”

The exchange apparently didn’t persuade Kraushaar to change his original opinion. “Like President Trump, Congresswoman Ocasio-Cortez is a master of the muck, using the platform to . . . debase our discourse with catchy put-downs instead of engaging in serious debate,” he said via email. “Those qualities make her successful on social media, but not necessarily in Washington.”

He added, “I welcome good-faith criticism from readers and colleagues, but when a member of Congress uses their power to send a social media mob against their critics, it’s an abuse of power.”

Ocasio-Cortez’s staffers declined to discuss their boss’s approach regarding the media for this article. A spokesman, Corbin Trent, responded to a lengthy list of questions with a one-sentence reply: “I think the Congresswoman has spoken for herself plenty on this topic.”

Ocasio-Cortez — or @AOC to her 2.8 million Twitter followers — came out swinging again last month after news organizations wrote up her appearance on “Late Night With Stephen Colbert.” During the program, Colbert asked the 29-year-old representative how concerned she was when her fellow Democrats tell her to “ ‘wait your turn, go slow, don’t ask for so much so fast right now.’ ”

Colbert then framed his question this way: “On a scale from zero to some, how many f---s do you give” about such comments?

Ocasio-Cortez formed her hand into a circle, smiled and said to applause and laughter, “I think it’s zero.”

The next day, she lit into the Hill, which summarized its story by using Colbert’s language in its headline: “Ocasio-Cortez: I give ‘zero’ f---s about pushback from other Democrats.”

Ocasio-Cortez tweeted: “I actually didn’t say this, so while I know ‘brown women cursing’ drives clicks, maybe you accurately quote the whole exchange instead of manipulating people into thinking I said this sentence instead of just the word ‘zero.’ ” The Hill’s article did, in fact, quote the exchange.

The Hill’s editor, Bob Cusack, stands by the coverage. “Our headline and article was accurate, but in the world of politics, there’s a lot of give and take,” he said. “The congresswoman objected to it, and that’s her right.”

She also snarked at Politico, which ran a similar headline, and at the New York Post, which she wrote not only ran with “the false quote, but [added] an angry photo to boot. . . . This is how news hysteria develops out of nothing at all.”

The response hints at another way in which Ocasio-Cortez is like Trump: She sometimes misstates or exaggerates facts, and is reluctant to own up to it when called on it.

After The Washington Post’s Fact Checker column handed Ocasio-Cortez four Pinnochios, the lowest rating for factuality, for her misleading claim that $21 trillion in Pentagon accounting errors could fund two-thirds of the projected cost of universal health care, Ocasio-Cortez clapped back in an interview on CBS’s “60 Minutes.”

Asked about this statement, she replied, “I think that there’s a lot of people more concerned about being precisely, factually and semantically correct than about being morally right,” an approach that drew some criticism.

She offered an even more convoluted and no more contrite response to the fact-checking of her statements about “living” wages, including her assertion that Walmart and Amazon are “paying people less than the minimum wage.” (Amazon chief executive Jeffrey P. Bezos owns The Washington Post). Glenn Kessler, editor and chief writer of the Fact Checker, rated her statements three Pinnochios, effectively “mostly false.”

Alerted by aides that Kessler’s column was forthcoming, @AOC replied with pre-emptive sarcasm. She tweeted, “Me: ‘I don’t think billionaires should concentrate wealth while employing people who are sleeping in cars working a zillion hours to survive.

“Next day: ‘That will be TEN PINOCCHIOS to Ocasio, “zillion” is not a number and I found someone who sleeps in a tent, not a car.’ ”

Last week, Ocasio-Cortez stirred some honey into her vinegary comments about the news media. She tweeted a clip of herself being interviewed on MSNBC and praised “Meet the Press” moderator Chuck Todd for hosting “a thoughtful 20 min conversation that wasn’t hung up on conflict, but exploration.”

Hard to imagine Trump doing that.