HBO’s tech spoof Silicon Valley returns Sunday for another round.

The sophomore comedy, which follows the fictional data compression start-up Pied Piper, picks up after Richard (Thomas Middleditch) and his fellow quirky programmers won Tech Crunch Disrupt and a life-sized $50,000 check.

Of course, that’s nothing compared to the money all the venture capital firms are offering them now that they’re the hottest start-up in town. But it won’t be a smooth ride for the gang as Gavin Belson (Matt Ross) and his tech giant Hooli are intent on squashing Pied Piper straight out of the gate.

Off-screen, the team behind the Mike Judge-created show faced challenges of its own. Among them: dealing with death of castmember Christopher Evan Welch, struggling to keep maintain the underdog ethos of its five core characters and continuing to make a complex, technical world engaging to the average viewer.

Ahead of the Emmy-nominated comedy's April 12 return, The Hollywood Reporter caught up with executive producer Alec Berg to discuss desired cameos, Elon Musk’s criticism and pressure to keep up with the tech world.

Read more Winklevoss Twins to Cameo on HBO's 'Silicon Valley'

One of the challenges your team faced this past year was the death of Welch, who played quirky angel investor Peter Gregory. How’d you determine the most appropriate way to write off his character in the show?

I called a few different people who had been on TV shows who had lost actors. They were super helpful, and really they all had the same advice, which was, “You have to be smart and compassionate, but also you've got to be funny because you’re a comedy show and you owe it to the character to send them off in a funny way.” Initially we had a conversation about, "Well, Chris is gone, but is the Peter Gregory character going to die or are we going to do something where he doesn’t." We had joked about him being on his personal nuclear-powered submarine, mediating under the polar ice cap, and every once in a while he would surface to send some email correspondence and then go back down. But it just felt disingenuous, and it felt like fans of the show will know that Chris is no longer with us, and they just know that he’s never coming back. It felt fake and ultimately unsatisfying, so we just decided we had to meet it head on.

How did you draw inspiration for his characters' memorial service?

The reality is that Peter Gregory’s office — the shelves and stuff — is basically patterned off of a pretty famous picture of Steve Jobs in his office. So we were able to look at the Steve Jobs memorial that was held at the Apple campus and draw from that. If you look at the photos of the Steve Jobs memorial, they very heavily influenced how we handled our Peter Gregory memorial. It was brutal, though; it was super hard. I haven’t actually corresponded with Chris’ family. Mike spoke to them about how we were thinking of handling it, and their directive really was, "Look, just be funny. Make it funny because that’s what he loved about the show.” But when we were shooting that memorial stuff. the fact is that we’re standing there with these 40-foot-high photos of the character, but they are also 40-foot-high photos of a dear friend of ours who is no longer with us. The real man had passed away, and it just reminded you that you have to be respectful and handle this carefully. So far, I’m really happy with how that’s been playing.

See more HBO's 'Silicon Valley': First Look at Season 2

The show has received criticism for not having enough women in it. This year, however, you've added two additional women, Suzanne Cryer and Alice Wetterlund. How much of that decision was a response to those critiques?

None. I think people who have complained about the lack of women of the show will see it as, “Aha! I complained and they listened and addressed my complaint, and I have controlled the course of the show.” But the fact is we don’t have any gender-biased directive on the show. There was no agenda in the beginning to make everyone male. I totally understand the criticism, but at the same time this is a show about guys who do something that 87 percent of the time in Silicon Valley is done by a man. We didn’t invent that gender bias. That’s real. I do think we’ve gotten some flack for not having a lot of women characters, but guess what? The tech business doesn’t have a lot of women characters, so I think we’re depicting an actual gender bias. We’re not making it up.

Beyond dealing with the death of a castmember, what were the other new challenges you faced this season?

In general with this show, there are a couple of big challenges. One is that what they do is actually not filmable. You can’t just watch people type all day, and you can’t really show screenshots of code and make it interesting in any way. So we have to find emotions and desires and conflicts, and what they do for a living has to play in that. But it’s not like a hospital show or a cop show where somebody responding to a drunk and disorderly is actually interesting to watch. Somebody writing a subroutine is unbelievable boring.

Then there’s the existential challenge of the show, which is that these guys are underdogs and outsiders who are trying to get somewhere, and as soon as they get there, the show ceases to be interesting. But at the same time, if you keep pulling the football away, eventually people are just going to go, “Ugh, these guys keep failing and failing.” So we have to keep inventing new interesting twists and turns on the road to success. The Practice is one of my favorite shows of all time, and the first few seasons of that show were amazing, and then when they started winning the big case, it just got less interesting. We always cite the Bad News Bears as an example as well. As soon as the Bad News Bears win the championship, they’re just the Bears; there’s not really that much bad news anymore. That’s the trick of the show going forward is how many times can we keep yanking the brass ring away from them before it gets frustrating.

Read more HBO's 'Silicon Valley' Tech Advisor on Realism, Possible Elon Musk Cameo

It does raise questions about possible future seasons of the series. Where does a show about a start-up go if and when that start-up becomes a hugely successful company?

That’s a very good question. I’m dying to know the answer. I don’t think we have the long-term of it figured out at all. We don’t have a six-season plan. To be honest, we don’t even have a three-season plan. The cupboard is pretty bare right now. We’re figuring it out as it goes.

What’s been different about this season compared to the first?

We literally had no idea how the tech business worked at all when we started working. Mike sort of jokes about that. After the pilot, we looked at each other and said, “It’s really hard to write a show about people doing something when we don’t know what they do.” So, we just started asking a lot of questions. It actually ended up being enormously helpful, and it made the show a lot more accurate when we were able put ourselves in rooms with lots of people who we could ask: What would these guys actually be doing? What would be the challenges they face? What sorts of things would happen to people like this?

How'd did you go about approaching real life tech titans for advice this time around?

Well, it was a little easier this season. Last season, nobody knew who we were and there was a — I don’t want to say distrust — but nobody was aware of what we were doing, and they were a little suspicious that they were all going to get their teeth kicked in, so it was harder to get time with people. But this year, people had seen the show. We were in Palo Alto for a couple of days and San Francisco for a couple of days. We went to Dropbox and Twitter, and they were all very forthcoming with their thoughts and suggestions for what would happen now. The gift of this show is that a lot of the stuff that is perceived as keenly observed satire is really just us hearing stories and saying, “Well that’s funny. Let’s put that in.” We don’t have to invent a lot of stuff. A lot of things just happen, and we get credit for creating them simply by depicting them.

Watch more 'Silicon Valley' Creator Mike Judge on Misogyny in the Tech Industry

Were there any real life tech players that proved especially helpful as you were mapping out this season?

Yeah, [venture capitalist] Marc Andreessen was a big fan of the first season. We had a really funny meeting with him where he came in and just said, “OK, I’m going to be a writer on your show. I’m going to pitch you ideas.” And for an hour he just pitched us: “You should do this, you should do that.” That was very entertaining. He’s an immensely charming, frighteningly intelligent man.

We already know that the premiere episode is packed with cameos, including ones from the Winklevoss twins and Snapchat CEO Evan Spiegel. Which tech players don’t make an appearance this season that you’re hoping to enlist in the future?

The door is always open for Mark Zuckerberg. We thought we had figured out a way to use Bill Gates, but that didn’t come together. At a certain point, how many people are there in that business that are so universally known? Once you get below the Mark Zuckerberg stratosphere, there’s not a lot of options. I don’t think anyone at home is going, “Holy shit, that’s Jeremy from Yelp.”

What about Elon Musk?

We did a Q&A with [Re/Code's] Kara Swisher after [our Northern California premiere], and I don’t know if she was full of shit or not, but she said that she had been texting with Elon Musk, and apparently Elon was going to weigh in with some criticism of the show. It’s funny, he’s gotten sort of unfairly sandbagged for that. Re/Code wrote the initial piece that said, “He hates it.” But if you read what he actually said, he didn’t say that he hated it. He just said that he didn’t think it was that accurate. But also, you have to take into account that it’s not accurate to his version of the way the tech world works, and his version of the way things work may not be everyone else’s version. I have a feeling that life as a billionaire in Silicon Valley is very different than the life that you or I would lead. Unless you’re a billionaire; I don’t know your financial situation.

Perhaps we’ll see Richard and the gang end up in a position like that in season seven?

Oh God, I can’t even think about a season three right now...

Silicon Valley airs Sundays at 10 p.m. on HBO. Will you be watching?