Mr. Robot” creator Sam Esmail and “Billions” co-creator David Levien hit it off the moment they met. The famed Algonquin Hotel was the perfect setting for a conversation with the showrunners behind two intense dramas that could only be set in New York City. As soon as they sat down, Esmail and Levien began to compare notes, trade compliments and swap tips about lensing in the city. They also offered the kind of detailed observations about each other’s shows that went well beyond lip service. [Esmail was envious of the nine-day shooting schedule for Showtime’s “Billions”; Levien, who co-runs his show with co-creator Brian Koppelman, was impressed by the amount of location work on USA’s “Robot.”] The mood in the room was enlivened by the presence of Emmy Rossum, Esmail’s fiancee and the star of Showtime’s “Shameless.” She took a firm hand in directing the photo shoot. But the real scene-stealer was Esmail and Rossum’s sweet-natured rescue pup, Pepper, who was just the right mix of excitable and adorable.

Both of your shows revolve around maverick individuals battling great institutions of authority to achieve their own view of justice. How does that work as a plot engine?

Sam Esmail: To me it’s sort of a universal element for being a person. There’s something in the human spirit that has that revolutionary thing. Because I’m Egyptian, I went over to Egypt after the Arab Spring. I saw my cousins, who were in their late teens and early 20s, and how they wanted justice, how they wanted to change the world. I think that’s a universal element of humanity.

David Levien: The way that “Mr. Robot” goes after it is just a great archetype — the individual or the underdog band going against the monolithic overlords. That’s a great dramatic structure. In “Billions” we ended up, in a way, going into the same terrain, but obviously a different route. You see that even though [Damian Lewis’ hedge fund kingpin Bobby Axelrod] is a billionaire he worries about how to raise his kids. He worries about money — he worries about a lot more money than most people, but he has these concerns. And then on the flip side we thought it was interesting to have the guy going after him [Paul Giamatti’s federal prosecutor Chuck Rhoades] potentially be not so noble as might be expected.

Esmail: I love the moral ambiguity on “Billions.” The guy who’s fighting for justice — our justice, supposedly — is kind of questionable and so you’re siding with Axe even though he is the One Percent. There’s not really a clear-cut good guy or bad guy.

Levien: For us that was really animating. There’s some good and bad in everybody. You guys go at it with antiheroes, especially [Rami Malek’s Elliot Alderson on “Robot”]. He’s got issues. He’s got the drug thing. He’s not a typical pure-bred hero, which is a great way to go at it.

Your shows are both graced with terrific casts, and you give them a great deal of complicated material. What’s the line between a scene becoming speech-y versus delivering vital exposition?

Levien: We feel completely fortunate with our cast. These actors are the ones that will bring everything out of the text and more. If it’s not there they’ll bring something up and try to go deeper. The way we go about it is to tell these stories about these characters and not try to make it a polemic. We try to make them say things they would say as [regular] people. I’m not going to claim that our show doesn’t have the occasional monologue in it because we do. That’s one of the facets of the show. The guys can talk.

Esmail: We have a couple of monologues, too. People generally don’t talk in monologues in real life. I don’t know if we’re going for real life. We are taking creative license. We are creating a piece of fiction, but at the same time I think what helps them sound plausible is what the actor brings to it. One of the things I always talk about is, when we auditioned for Elliot we used the “F–k Society” speech from the pilot. We were bringing in great actors, but it wasn’t feeling right. It started to feel speech-y and didactic. I thought, “This isn’t a great script.” I was going to abandon the whole thing … and then Rami came in and just added that vulnerability to it.

Levien: We had a similar experience with the Wendy Rhoades character [played by Maggie Siff]. We read like 100 actresses — some were great, but it wasn’t quite the character. You start to say, “Do we need to rewrite this thing because we’re not seeing it?” And then all of a sudden Maggie Siff’s audition tape shows up and she just knocked it out of the park.

Esmail: She’s great. I love her and I love that character. Is that real, by the way?

Levien: You mean performance coaches at hedge funds? Yes, there are some of them out there.

How specifically did you map out your first-season story arc before you began filming? Did your plans change much along the way?

Esmail: I thought of [“Robot”] as a feature first so I knew a lot of the big beats. Obviously I didn’t know every character beat. What we did in our room was, I put up my outline and my initial thoughts of what the season was going to look like with all of those big markers, and we would go through every episode and fill out the rest of the details. We’d do a general arc overview of every character, every storyline, who they’d intersect with.

Levien: We sort of had a midpoint of where we were going to be in the season and we had a rough idea of the endpoint when we got started. Then we had a bunch of rough ideas for episodes, especially the close-ended elements because we have a bunch of stories that close in any given episode to go along with the serialized stuff. We definitely tried to sketch out as best we could where the characters were going to go and end up along the way. Then we tried to get really in detail on the first seven episodes. We weren’t flying blind, but we didn’t have all the answers. We just trusted that the moves we were finding along the way would serve this end point and we would find a way to deepen it.

Did you have any guest stars that you loved so much you expanded their characters to keep them on the show?

Esmail: I was always tempted to, but maybe I have a one-track mind. Elliot Villar did such a great job as Fernando Vera. He brought this really interesting and different kind of villain to the story but I was like, “No way. We have to stick to the story so he’s not in the show right now.” It’s hard to avoid that. When you walk into something like that when actor meets character and they have this great synergy, it’s really tempting to continue to write for them.

Levien: We knew we wanted a character from the attorney general’s office to come in and shake things up for Chuck, and we always thought if we get the right person it could be something that grows, otherwise it could be more minimal. We ended up getting Rob Morrow. We loved him so much. It was very organic. As we began breaking later episodes we realized this is a perfect point for this guy to show up and make a certain move, and suddenly he was in four episodes or more. It’s just a natural thing — you like writing for a person and know they’re doing a great job.

You both seem to enjoy casting against type. It was fun seeing Anthony Edwards play a corrupt judge in “Billions.” And I’m looking forward to seeing what you do, Sam, with Craig Robinson in season two.

Levien: We talked to [Edwards] and he said, “You’re saying I get to be a bad guy?” We said, “You’re a bad judge.” And he said, “All right, I’ll do it.”

Esmail: I love him.

New York City is such a part of the texture of both shows. Sam, is it true you shot all of those subway scenes actually in the subway?

Levien: Did you get permitted? That’s impressive.

Esmail: Yeah, we got permitted. There are certain subway stations where you can shoot  — you had to be on a certain track at a certain time. It pays to have a great location manager and our location manager is amazing. … You don’t get a lot of time when you do get in there and it’s really expensive. But I think it just beats green screen. Sound [quality] was a challenge,  but at the end of the day so worth it. There’s just a texture you get by using the real subway stations. For me in the pilot, the tone was really set when we got to that subway station scene between Elliot and Mr. Robot.

You’re both relatively new to the job of showrunning. What surprised you about the job?

Levien: Coming out of making movies, the idea of making the equivalent of six movies in one year would have seemed impossible. I would have doubted that you could do it with the right level of quality, but somehow the thing gets momentum. We hired the right people. It was a really pleasant surprise that our people were so good and strong. The [show] grew and got better. That was the exciting part for us.

Esmail: I had only done one independent feature [before “Robot”]. When you make an indie film you’re always running and gunning anyway. In a weird way TV’s like that. You have a lot more money and you’re shooting a lot more, but it does feel like my indie film set to a certain extent. You’re still having to run through a lot of pages every day because you never have enough time or money. You just have to have that momentum, that energy of always trying to get to the highest quality but also coming up with creative solutions.

Yet another thing you have in common — high expectations for season two. How does that pressure compare to the challenge of launching a show?

Levien [looks at Sam]: Do you have something really esoteric to say to that?

Esmail: Well, there’s a lot of confidence, right, because you obviously appreciate and are humbled by all the attention you got for the first season. But the pressure sort of cancels all that out — so you’re just back to square one. Which I think is a good thing. That moment before the first season where there were no expectations — that’s where you should always be. It just keeps you honest during the creative process.

Levien: We were sort of laboring with the question as to whether anybody would get this or care given the nature of our show. The fact that anybody got it, and not just people on Wall Street, was great. Now this season the writers’ room knows the kinds of things that Chuck and Axe and the rest of them would do much more clearly than the first season, which is great. But on the other hand, we don’t want them to do the same things. It’s like a terrible and great problem at the same time.