Silicon Valley type TV Show network HBO

[SPOILER ALERT: Do not read this story until you have seen Sunday night’s season finale of Silicon Valley.]

To the victor goes the spoils, but for Pied Piper, victory is almost always spoiled. That was truer than ever in Silicon Valley‘s stressful, stellar season 2 finale, “Two Days of the Condor.” The HBO comedy about a scrappy tech start-up gave Richard (Thomas Middleditch) and his middle-out mates a huge triumph in their season-long legal war with Hooli, but also dropped a buzzkill bomb on the gang in the episode’s final moments as Raviga managing partner Laurie Bream (Suzanne Cryer) called an emergency board meeting and ousted Richard as CEO of the very company that he founded. Why so much pain for Pied Piper? Where does that leave Richard & Co.? EW requested a sidebar with the judge—Silicon creator/executive producer Mike Judge—to get some answers to our questions.

ENTERTAINMENT WEEKLY: Last season ended with Pied Piper winning TechCrunch Disrupt, scoring $50,000, and theoretically pleasuring many men. This season was a rough one for the crew from the start, and ended with Raviga seizing control of the company and Richard being fired. Did you just really want to put them through the ringer this season, even more so than last year?

MIKE JUDGE: I don’t remember starting out that way. But after winning, in reality if that really happened, you would get successful pretty quickly, so we did start out saying, “Okay, we’ve got to figure out how to have things go badly.” Maybe we went overboard. [Laughs] What we do is lots of research and gather up stories, so a lot of this was just real stuff that happened. It is fun to put the characters through hell. These actors are all really funny when they are stressed out and getting dumped on, so why not?

This episode plays almost like an action thriller, with Richard frantically rushing to tell everyone at Pied Piper to ignore his previous order to erase the platform. Did you set out to make a different kind of episode? And which scene was most fun for you guys to film?

It does play like a little bit of a different kind of episode. I don’t know that we set out to do that—I think it just happened. I really like the whole race to get back. I wasn’t actually around for that because Alec [Berg, the Silicon co-showrunner who wrote and directed the finale] and I were both block-shooting the last two episodes and I was directing the second-to-last episode. I love when Richard comes in at the end of it. I thought [Thomas] played that so well, when he’s telling [Martin Starr’s Gilfoyl] not to delete it. My favorite moment is when he thinks it is deleted, and he definitely did not delete it because of Dinesh’s s— software. [Laughs] That’s sort of an emotional moment, and it’s fun watching them all play that.

Martin Starr is a really great actor. It was kind of cool to see him doing something different. He’s actually smiling but in a way that all seems in character. He was fun to watch in this episode because it’s a different thing for him. I thought he pulled it off really well. The stuff with him and Kumail [Nanjiani, who plays Dinesh]—I just love them arguing about hardware/software.

You’ve thrown a big wrench in the works for Richard. What happens to him now? He still has a board seat, and he owns part of the company, right? Where do we find him next season?

Honestly, Alec and I had one conversation about it that was maybe a minute long. We were so trying to get this season done that we’ve barely even talked about it. But there is plenty of real life stuff to draw from here. There are different ways that that’s handled. It happens all the time. Raviga now has the right to hire whoever they want as CEO because they can outvote the others. And it is most likely going to turn into some kind of ugly battle.

Do you see him as an outsider trying to fight his way back in next season?

Yeah, that’s one way to go. We’ve got our work cut out for us. We put that in there not knowing exactly where we were going to go with it. I really don’t have an answer. The situation is, he’s only got one seat and Erlich [T.J. Miller] is his friend, but they can be outvoted on anything. He still owns a big piece of it, though. So he could get rich or other things can happen. People can fight their way back in, like you say. That’s one way to go. We shall see.

The episode ends with Erlich (T.J. Miller) asking the question: “And what about me?” What does this mean for Erlich and the rest of the Pied Piper crew? Do they remain together while trying to figure out a way to undermine the new CEO and bring Richard back into the fold?

They are people who own a share of it, but they don’t have to work on it. And a new CEO would have to figure out does he or she want them involved at all? It’s one of those things, like: What exactly do you own here? There’s the algorithm and there’s the people. Sometimes companies are bought for the people involved more than the tech, and sometimes they’re bought for the tech itself. And that’s something we can explore in the new season. What’s Pied Piper? Is it worth what it’s worth because of the algorithm or because of the people? That’s a question that people have.

Well, Laurie seems more interested in the technology than the people of Piper, whom she views as screw-ups.

There could also be something to the way that Dinesh and Gilfoyle handled that crisis situation and all those people out of their garage. That might be of some value. Sometimes you see the founders pitted against each other in interesting ways. The draft before that had a meeting and Richard being self-deprecating about how much he screwed up and kind of realizing that he’s just spelling out what a horrible CEO he is.

All season long we’ve been focusing on Hooli CEO Gavin Belson (Matt Ross) as the big bad, but with Gavin being vanquished—temporarily—we barely noticed the enemy within: Raviga, specifically Laurie. Was it always the plan to have her be a massive problem for Pied Piper?

Yes. We came up with that fairly early in the process, that it would wind up with Raviga having three board seats, and Richard gets fired. I remember we were even reverse-engineering it in the casting process, going like, “Okay, this is the woman who’s going to fire him in the end.”

After being introduced as Peter Gregory’s replacement, Laurie turned out not to a big presence this season. Will that change next season? Do you see positioning her as the new Gavin Belson in terms of the big obstacle for Pied Piper?

I love the way that Suzanne plays that character. It’s something we could really do a lot with. I like her and Amanda [Crews, who plays Monica] together. I like her and the guys—seeing a woman character like that in the tech world is interesting. Yeah, I want to do more with her, for sure.

Big Head (Josh Brener) is positioned for big things at the end of this episode. He wasn’t around enough this season. Can we expect to see him more frequently next season, and what can we expect from him when we do? A lot more startled, tentative “okay”s?

When we started in the first season and we realized that we had to do something with him, otherwise he would be redundant to the other guys—or to Richard, anyway. And we had heard about these rest-and-vest deals that guys have. But going into that, I didn’t realize how much fun it would be to watch Josh play a guy who’s just completely useless and doesn’t care and has no ambition. I’d love to see him just fail upward—and there’s going to be more of that.

The arbitration verdict has a surprise twist [in which the judge rules that Hooli would own Pied Piper’s underlying IP because Richard worked on it using a Hooli computer, but Hooli’s illegal employment agreement with Richard cancels that out]. Did you guys tinker with different outcomes on that case in the writers room?

Originally, we talked about a thing that happened to me and some other people at MTV—I think Dan Cortese had a similar thing—where their contract with us was so aggressive that it actually violated labor laws. So I was able to get out of it. This is what I remember hearing. And then Jonathan Dotan, our consultant on the show, looked into legal things that happened, and this seemed like a really interesting one, because the contract violated Jared’s right to work, not Richard’s. It’s an interesting thing that the contract was so aggressive about, “You’re not allowed to hire anybody from this company,” but it violates Jared’s rights, making that contract invalid. From fairly early on in the season, that’s how we were going to end it. That seemed like a really interesting thing to all of us. And it’s a real thing. We had more stuff that we cut out with the judge complaining about his commute. He’s a guy who can’t afford to live in Palo Alto anymore, so he’s got to live way down in Gilroy or something and he commutes. He’s already irritated with tech people, and here’s this huge company—the companies get very arrogant and they ignore California labor laws, and judges love to just go, “Hey! Over here! You may be a billionaire, but we’re the law. You can’t do that.”

Can you give us a cryptic one-sentence tease for next season?

What was it last season, mo’ money, mo’ problems? How about: Mo’ problems, mo’ money.

What happened to Carla [Alice Wetterlund], by the way? After being introduced in episode 4, she was rarely seen, and then apparently quit off-screen with the other coders.

That was our frantic rewriting of the last episode. We had a scene with the coders quitting and her coming back and it just became a victim of us frantically rewriting and putting everything together. But I think we’ll see more of her. People seemed to like her, too. We want to have her back.

What was your favorite story line of the season, and, on the flip side, which one didn’t turn out as well as you’d hoped?

I really liked the hacking of End Frame and Richard becoming a black hat. Seeing somebody get corrupted because that’s what you’ve got to do to succeed. It’s like athletes taking steroids: “If you want to compete, everyone else is doing it.”…If I had to say something that I thought that didn’t pan out… I’d say us trying to having some romance between Richard and Monica. But I like the way we shut it down. It was actually a line that Thomas improved: “I was going to say if you had, you’d have to show me yours too.” [Laughs] It was like, “Okay, well, that’s over.”