Now in production for its third season, “Mr. Robot” is never far from the pulse of current events. A couple of weeks ago, the dystopian computer hacker drama was in mid-shoot at an FBI field office when news broke that bureau Director James Comey had been fired. “One of the lines of dialogue is referencing Comey,” Sam Esmail, the show’s creator, recalled. “That was a little surreal and kind of an out-of-body experience.”

Esmail might as easily be describing the USA Network series, whose dark and downbeat second season unfolded much within the imagination of its mentally unstable antihero, Elliot Alderson (Rami Malek), as he fought to free himself from his manipulative alter-ego, Mr. Robot (Christian Slater). By season’s end, fsociety — the underground hacktivist group led by the sidelined Elliot — was shattered, and a deadly, explosive plot hatched by Mr. Robot and the Dark Army, a cryptic Chinese organization, was about to go off. Elliot himself lay bleeding, shot by a character he believed to be a delusional figment.

The show’s license to be uncanny is endorsed by the headlines, argues its star.

“As ridiculous as this sounds, I feel that I’m reading my scripts as if I could be reading the L.A. Times tomorrow,” said Malek, speaking by phone during a lunch break from a location shoot on New York City’s Broadway. “I would approach Sam and say, ‘Do you really believe that this is possible?’ At one point he goes, ‘Look, it’s not outside the range of possibility that Trump could become president. If that could happen, all the events that take place on our show can.’ ”

The new season promises more shock and surprise, and a significant shift in gear, as Elliot returns to the increasingly chaotic real world. “This is the part of the movie where things ramp up and get very exciting,” Malek said.

Portia Doubleday, whose Angela Moss faced a moral crisis as a hacktivist-turned-executive for the sinister E Corp., underscores a fresh urgency to the story line. “Angela is constantly teetering on the edge of either side,” she said. “I had no idea what was going to go on this season, and when Sam told me I was, like, ‘You’ve got to be freaking kidding me.’

“So much goes down this season,” she continued. “There’s a lot of hacking that’s really fun, and it’s always exciting because it inevitably leads to something terrible … or who knows?”

USA Network

That should please critics and fans who felt stymied by last season’s sometimes tangled and less plot-driven approach, which included a major midseason twist, and focused more on character development and murky atmosphere than action. The complaints don’t bother Esmail. “Season 2 was superior to Season 1 in every way,” he said. “I happen to like a story that slows down and goes into that more internal world of a character.”

That gave more screen time to supporting actors like Doubleday and Carly Chaikin, whose Darlene — Elliot’s tough-talking sister — takes over leadership of fsociety, only to end up in the custody of indefatigable FBI field agent Dom DiPierro (Grace Gummer). “She’s stuck between a rock and a hard place,” Chaikin said. “It’s funny, on this show we work really hard and on top of it we’re doing the most depressing, heavy stuff every day. Last season I’m telling my friend, ‘Oh, I’m getting ready to go to work. I have to go kill someone and have a panic attack.’ What did I sign up for? As actors, it’s a dream day.”

The most out-of-the-box performances last season were in the fifth episode, written by Adam Penn, which spoofed the forced jollity of 1990s family situation comedies. Esmail praises other examples of this kind of envelope pushing, notably on Donald Glover’s hip-hop-themed series “Atlanta.” “They had a whole episode that was on this fake network and they went everywhere,” he said. “This elasticity is something I really enjoy as a viewer, and we took that approach to a large extent in the second season.”

Esmail also rhapsodizes about “The Leftovers,” which is about to conclude its third and final season on HBO. “Damon Lindelof is one of my heroes,” he said. “Every episode is going into this crazy, surreal, adventurous plot. It’s the one thing I really appreciate about any show and the one thing I really hold ourselves to in the writers room: What is the most creative way to tell this story? That’s really ultimately what it’s all about.”