When he was a teenager in Pakistan, Kumail Nanjiani came up with a foolproof plan for infiltrating the popular high school crowd: It involved walking very slowly (like LL Cool J), laughing in a subdued manner, and memorizing the lyrics to Snow’s “Informer.” The plan backfired miserably; yet, as his Comedy Central monologue of the tale attests, the 36-year-old Los Angeles–based Nanjiani got the last (and not at all subdued) laugh. A computer science and philosophy major–turned–actor on HBO’s Silicon Valley who also hosts a podcast for X-Files fans in his spare time, Nanjiani has the kind of career we admire most: one that’s a testament to studying hard, sticking with it, and carefully regulating your recreational time.

I read that you give yourself three hours a day to play video games.
I have a reward-and-punishment system: If I have done this much work, then I can play video games this long. It gives my day structure.

Did you always love video games?
I was not a very social kid. I didn’t like sports, partly because Karachi is safer inside than it is outside—which is true for most places, but Karachi has definitely had issues. My parents didn’t want me to go outside and play, so it worked out.

I had a Commodore 64, and I just fell in love with the video games. Then I got a Sega Genesis when I went to Singapore, where my aunt lives. My first game on it was called Golden Axe.

A lot of people say video games can be stifling. Older people say, “We had to go outside, and we had to make up stories!” For me, video games broadened my horizons. Playing Golden Axe, I was those characters. I imagined myself being in that world, so honestly, it was a really good thing. I would start writing stories set in those worlds. They never went anywhere, but that was the first time I wanted to write about that kind of stuff.

JUCO

You wrote video game fan fiction?
Yeah. I think it’s an interesting way to tell stories. Not all video games are interesting, and not all of them are doing something unique, but a lot of them are.

What were your first exposures to comedy?
Movies. Ghostbusters. Bill Murray stuff.

If I could do the Freaky Friday thing with anybody, it would be Bill Murray.
I would do it with the Rock! Any five minutes of the Rock’s day, I’ll take. Even if he’s in the bathroom. I want to see what that’s like!

I really like Bill Murray, but I was more into sci-fi and horror, like A Nightmare on Elm Street. Ghostbusters and Gremlins were at the intersection of everything I liked. I watched a lot of Bollywood. And Looney Tunes.

Most of my exposure to American pop culture was through this weird prism of Mad magazine. We would go to this place called Friday Bazaar, this huge field where people had stalls selling fruit and vegetables but also VHS tapes, books, and magazines. I would always look for Mad and magazines about horror movies, sci-fi, and video games—all very cool! Not nerdy at all!

You wrote a one-man show, Unpronounceable, about growing up in Pakistan, which ruffled some feathers.
It was my first show. Before that, my comedy had been one-liners and punches. I didn’t do autobiographical or ethnic stuff because I didn’t want to be defined by that. Unpronounceable was about me growing up in a very religious Shiite Muslim household, moving to America, and becoming more used to America. It was a story about how my journey with Islam related to my journey with my parents and our ongoing relationship. Some people thought it was controversial.

JUCO

But it had a good effect on your career.
That’s how I got my first manager and my first agent. It helped me move from Chicago to New York. It changed the way I approached comedy. It helped me articulate how I felt about where I was from, how I was raised, who I am now, and my identity. I realized that talking about something that was so difficult made it easier to talk about something else. I realized you can do anything you want on stage.

What first made you want to pursue stand-up?
In high school, I was very shy. When I moved to the U.S. and started going to college, I became the funny guy. A friend of mine started doing a comedy open mic at a coffee shop. I was like, “I’ve got to do this.”

I would go to my uncle’s house in Orlando and record HBO comedy specials. I watched all the stand-up they had. I watched so much good stand-up and so much bad stand-up, and in about six months I went from never having seen it to having a pretty good appreciation for it. I didn’t know if I could be funny on stage or write a joke. But I saw that there are no rules. If you’re funny offstage, you can figure out a way to be funny onstage.

I gave myself six months to write material and then I performed. There were about 150 people in the audience. I did 25 minutes, some crazy ungodly amount of time for a first time doing stand-up, and it is, to this day, one of the best sets I’ve ever had.

JUCO

What’s the first step to writing a joke?
Realizing that writing is work. It’s not just that the heavens speak to you; you write and you write and you rewrite. Developing that work ethic, sitting down to write every single day, is what changed the way I approached writing. Don’t try to write anything good. Just write.

Stephen King will sit down to write 2,000 words a day, and he won’t stop until he hits that number. Do you have any rules like that, other than the video game reward system?
Now that I’ve been shooting Silicon Valley, it’s much harder. I have to be at work at 6 a.m. But I would always write first thing in the morning, and my only rule was I had to write for at least 10 minutes. Usually that turns into a couple of hours.

What do you do when you develop writer’s block?
When that happens, I think you’re getting into your head and you’re getting stuck. So just try to write about something else and then come back to it. Just walking around will help.

You’ve never had any low points where you thought about giving up?
When I had an office job from 9 till 6 and then was performing stand-up at night, there were times I didn’t know if I was going to make it. I never thought about quitting, but it was probably because I never really started, you know? But you keep moving the goal post. There’s always something next that’s slightly beyond your grasp to focus on. I don’t think of where I am going to be in five years. I only think of the next couple months. I’m not afraid of failure. I feel like being afraid of failure is being afraid of success. It’s the same thing.

iStock (del Toro, Podcast)

Do you pinpoint any particular event as your breakthrough?
It wasn’t one thing. Touring with Eugene Mirman was a big break, then opening for Stella was a big break, and then writing for Michael & Michael [Have Issues] was a big break. Portlandia really helped me get a lot of other jobs. Silicon Valley is probably the biggest thing that I’ve been involved with. I grew up watching [Silicon Valley creator Mike Judge’s] Beavis and Butt-Head and Office Space. I’m like, “This guy’s a genius.” Then I see his process working with it and how much rewriting and work go into it. For me, that was eye-opening. You have to pour sweat and blood into it.

Is it weird to go from being a fan of someone’s work to working with that person?
It was intimidating at first. What helps is that Mike’s just a normal guy who wants to hang out. He’s also a comedy genius. He’s just smart in every way, so he’s great at math and physics and comedy. Now, to me, he’s just like a friend and a coworker.

You have a computer science degree. Does that help you on the show?
No. [Laughs] It really does not. I mean, I was not good at it, so I guess that’s why.

So you’re not fact-checking scripts.
No. I know enough about computer science to know what we’re doing. But I think most people do now. I’m completely wasting my education.

How have your family and friends reacted to your success?
When I go to my parents’ house, they have articles and stuff of me framed—but they never talk about it. I get it. Where I’m from, there’s a certain number of viable careers, the standard ones. This is so outside their reality. Also, they’re not the target audience for my comedy. If I were doing a show and the audience was all Pakistani people in their sixties, I’d think, “Oh, God, I’m not going to do well.”

JUCO

Let’s talk about your X-Files Files podcast. How do you prepare for each episode?
I watch the show. I look up reviews to see if there are aspects I missed. I look up interviews with the writers. They have message boards archived on Google Groups. I go on and find what people were saying about the episode when it aired. That’s interesting—I’m seeing people’s immediate reactions to the show and the evolution of discourse on the Internet. It’s a matter of looking at the time and then understanding the show’s context and what it was commenting on.

If you could transport yourself into any other universe and have it be totally real, which one would it be?
Oh, man, that’s a tough one. I would go into the Golden Axe world. There were dragons and stuff, and it was awesome. You could kill a dragon and then just rest on that: “Oh, look, that guy killed a dragon.” Remember that?