If you saw the season finale of HBO's Silicon Valley, then you definitely know the joke we're talking about.

The Mike Judge show is about a group of friends and housemates struggling to launch a successful tech startup called Pied Piper without being squashed by a giant Google-like organization called Hooli. And the ridiculous, mathematically centered penis joke arrives as the five guys are sitting in a hotel room prepping for a tech conference presentation that could change their lives. It's crunch time, but instead of working on the task at hand they become consumed with developing an equation for how to give every member of the 400-person audience a hand job during their slotted 10-minute presentation time.

With that stellar ending to the show's first season, new shows in the works, and some hilarious new and old characters on Portlandia, the future is looking bright for comedian, writer, and actor Kumail Nanjiani, who will be performing in Phoenix this Friday with two of his Silicon Valley co-stars, T.J. Miller and Thomas Middleditch.

I just saw the finale of Silicon Valley. It was awesome. Thank you! Obviously, I've been a fan of Mike Judge forever. But what I like about the show more than any other show I've been on is that this show is about story and narrative. It's kind of cool that they told a full story in season one that works on it's own in case we didn't get to do another season.

What were some of your favorite moments from season one? I was just telling my wife that this is a show I would love even if I wasn't in it. I think the conversation when we really get into the math of how you could jack off 400 men came out so well. It was tough to shoot because we were shooting in a tiny hotel room for 14 hours. But we had to do it to make it believable.

You tweeted about Silicon Valley being the most gratifying thing you've ever done. Why has the experience been so rewarding for you? We all got together and watched the finale. We all get along so well and it's partially just personally because I love everyone I work with and we've bonded hardcore. It was also great to be a small part in a story Mike Judge told. I feel like I'm just talking about how great the show is, but I just love it. We worked so hard on it.

You and your co-stars, who are going to be performing with you at Stand Up Live, all seem pretty different. How do you think your styles blend together on stage? We haven't done stand-up together much. I've known those guys for over 10 years. We all occupy different territories, but we compliment each other and we're all trying to accomplish the same thing. It can be competitive, but in a good way. We push each other to be better.

What can fans expect from the show next season and your character Dinesh? There's a few options. They could start that day or jump forward a few months when Pied Piper is a more established company. I would love to see, with Dinesh, a bit more of his backstory. But I like when he's put in uncomfortable situations.

Do you feel a connection to Dinesh's character? I do a little bit because my parents were immigrants, and I was an immigrant. I understand the immigrant struggle. He really wants to make it here and, like other immigrants, he has to work really hard to get there.

You've done podcasts on videogames in the past and played a lot of nerdy characters. Why do you think comedy and nerd culture have been blending so much recently? A lot of nerd culture is about passion and about people really really caring about something that other people might not think is worthy of that sort of attention. I think comedy comes from the same place. To me, it's never funny if somebody doesn't give a shit about something. It's way funnier if they care way too much. Stand-up used to be about making fun of things and breaking them down, and now it's more personal and about people talking about what they like.

Did you always want to do comedy? Not until the end of college. It's not really even a option in Pakistan, or even here. So few people make it and it seems like an impractical thing to do.

What did you study in college? I had a double major in computer science and philosophy. I thought a computer job would be my life but as I was studying I found that I wasn't good at it and I didn't like doing it and it was boring. I was always the funny one among my friends, and I saw a friend of mine try stand-up at an open mic in college, and it just made sense.

Do you like stand-up more than acting or writing? I think I get juice from doing all of it. Doing writing and acting and performing all together make you better at all of them, I think.

I think, other than maybe Carrie Brownstein and Fred Armisen's work, you have some of the most memorable characters on Portlandia. How much input did you get in creating those characters? What happens is the director Jon Krisel, who is the genius behind the scenes, will e-mail me and tell me what he wants to happen in the scene. It's all heavily improvised. Then I e-mail him back with ideas and he tells me which direction to go. He gives me a lot of leeway, and Fred and Carrie have no idea what I'm going to do.

How do you get ideas for the characters then? I did a lot of research, like for instance when I'm the waiter, I say they have Slamburgers, well Cheesecake Factory has Glamburgers.

Oh, god. Yeah, oh god is right. It's just a regular hamburger but you have to call it a Glamburger. But anyways, then we just go off of each other, and it's all improvised.

Those scenes seem rehearsed, though. You play so well off of each other. I guess that's just because Jon is so amazing at writing and editing. We did a take that was 40 minutes long and I laugh a lot. I ruin a lot of takes.

You also worked with two of my favorite comedians, Michael Ian Black and Michael Showalter, as a writer on Michael and Michael Have Issues. With how Stella's run was cut short on Comedy Central before it, were you all kind of expecting it to end as quickly as it did? That was my first job. I was lucky they chose me to write and it was the first time I did any acting. Those guys are obviously amazing and I was so excited to be working with them. I thought the show would go on forever. I was honestly devastated when it got cancelled after seven episodes. It made me realize that you don't really have power over how that stuff goes, but you can control whether or not it's good.

So who has more issues: Michael Ian Black or Showalter? They both have issues in their own ways, trust me.

You've done voices for video games and animated shows. Why do you think people like to cast you as a voice actor? I have a very distinct voice. It's like Pakistani, but American, but British. I have so many friends that do impressions of me. For Walking Dead, I just loved that game so much. I e-mailed the guys who made it and they kind of made the part for me.

What video games are you playing right now? Oh. Really? My wife and I are playing Mario Kart 8, which is amazing. Do you play video games? Have you played it yet?

I do. I haven't played it yet. I definitely get down on old Super Mario Kart. It's so good. Me and my wife play every day and we're moving now too so whoever loses has to pack a box.

So aside from video games, what do you have coming up? I'm going to be going on a little tour this summer and then I'll go back and record the next season of Silicon Valley. Then I think maybe next May or June I'll be ready to record a new special, so in a year for now. Me and Jonah Ray are also recording eight episodes of a new comedy show that's shot in a comic book store for Comedy Central called The Meltdown with Jonah and Kumail.

Kumail Nanjiani will be performing with his Silicon Valley co-stars T.J. Miller and Thomas Middleditch at Stand Up Live on Friday, June 6. Tickets ($25) and more information are available at www.standuplive.com or by calling 480-719-6100.