Star Kumail Nanjiani on the Secret Code of ‘Silicon Valley’

If you’re a Asian American male trying to make it as an actor in Hollywood, it’s a given that you’ll find yourself regularly auditioning for a fairly narrow set of parts. As my friend Parry Shen once put it: “Hope you like playing delivery guys and crazy foreign exchange students.”

But if there’s any role that has become the bread and butter for the working Hollywood Asian, he explained, it’s the techie — “Good with computers, bad with women,” he quipped. It doesn’t matter the genre: On police dramas, it’s the white-coated forensics expert or the “guy in the van” who monitors the action while everyone else is kicking butt. On medical shows, it’s the anonymous whitecoat who pops in to announce the dire results of obscure tests, then disappears into his lab. On sitcoms, it’s the clerk in the Best Buy electronics aisle, or the heavily accented tech support dude appearing in split-screen from 12 time zones away. But hey, it’s a living!

(Shen is currently enjoying a delicious riff on the techie trope right now, playing conniving lab tech Bradley Cooper — no, not that Bradley Cooper — on the long-running soap “General Hospital”; the “bad with women” thing is moot in this case because Cooper is gay…and definitely not the married-and-monogamous type. Va va va voom.)

That’s why I initially flinched at HBO’s announcement that it was going to make a show showcasing and satirizing the quirks of the technology world for gawkers in the land beyond. As a stunted geek, having swapped programming for prose upon hitting college, and an Asian American guy, I’m acutely aware of the pitfalls that this show could easily have stumbled into.

I needn’t have worried. I saw the first two episodes of “Silicon Valley,” which premieres this Sunday, at SXSW with the cast and creators in attendance, and the show is laser-etched satire, full of what I like to call “funhouse truth” — exaggeration and hyperbole that effectively highlights the almost-as-absurd reality.

And it depicts the tech landscape’s distorted diversity — everyone is either a whiter shade of pale or some variety of Asian, nary a black or Latino to be found — with scathing authenticity; the series’ key antagonist, a preening master of the digital universe named Gavin Belson (Matt Ross), points this out in one of the premiere’s funniest lines: “It’s weird, they always travel in groups of five, these programmers. There’s always a tall skinny white guy, short skinny Asian guy, fat guy with a ponytail, some guy with crazy facial hair, and then an East Indian guy. It’s like they trade until they all have the right group.”

The “right group” could refer to the show’s cast as well. The five guys at the core of the show —Thomas Middleditch as Richard, the code monkey whose side project ends up launching a VC bidding war, T.J. Miller as Erlich, Richard’s self-appointed mentor, Martin Star as surly network guru Gilfoyle, Zach Woods replicating his awkward marketing guy persona from “The Office” as Jared and Kumail Nanjiani as arrogant programming prodigy Dinesh — are each individually brilliant. Collectively, their chemistry, both positive and negative, propels the show beyond zany workplace shtick and into the zone of potentially classic repertory comedy. It feels like the start(up) of something good.

That on-screen chemistry isn’t exactly accidental, points out Nanjiani, reached as he was getting ready to leave for Wednesday’s San Francisco pre-premiere preview in front of the hardest critics the show was likely to find — the denizens of the Valley itself. “I’ve known Thomas [Middleditch] and T.J. [Miller] for 10 years; we started in comedy in Chicago at the same time and we’ve been pals ever since then,” he says. When Nanjiani got wind that the show was in development, he told his agent that he wanted in, and ended up auditioning for the roles of Richard and Erlich. “The producers said, ‘Hey, we don’t think you’re right for those two, but we’ll write something for you. Which you always hear, but never happens. Then I got the call that they had. And it was the same for Martin [Star]. We weren’t in the original script, but they wrote us into the show.”

So — like startup success itself — the efficiently freewheeling vibe among the show’s players is part kismet, part engineering. Gathering the right talent for a project and catalyzing hilariously effective interplay among them without a high-profile star at the center is something at which “Silicon Valley”’s executive producer Mike Judge has always excelled, as seen in works ranging from “Beavis & Butthead” and “King of the Hill” to the cult-beloved feature film “Office Space.”

This project had a special place in Judge’s heart, notes Nanjiani: A UC-San Diego grad with a degree in physics, Judge began his own professional career as a test engineer at a Silicon Valley hardware startup; he’s been looking for the right way to work through and send up his love-hate relationship with the Valley ever since. The results show: The tech crowd, even as they’re getting lacerated by gags at the expense of their cultural exceptionalism, social awkwardness and bizarre self-indulgence, has lauded the show’s authenticity, roaring with laughter and applause at the SXSW screening and giving it a Google of Facebook “likes” at Wednesday’s tech insider’s preview.

“Mike really, really knows how everything works there,” says Nanjiani. “He went to great lengths to make the show as authentic as possible. He hired an on-set expert on Silicon Valley [culture]. We made sure all the technology language was accurate, and he ran all the onscreen code, all the background graphs and formulas, past grad students at Stanford to make sure it was correct. This crowd can smell inauthenticity.”

Part of the authenticity is Nanjiani himself. Born and raised until the age of 18 in Karachi, Pakistan (his parents now live in New Jersey, he says, “which means that in a lot of ways, they still live in Pakistan”), Nanjiani came to the U.S. to attend Grinnell College in Iowa, where he graduated with a degree in computer science and philosophy. “But I never really had an interest in programming, and I honestly was never any good at it,” he says. “I’d miss one class somewhere, and then could never catch up. So I sort of understand the code we’re typing on the show, but there’s no way I could actually write it.”

On the other hand, his college experience put him on the pathway to future, equally geeky interests, which include comics, science fiction and especially video games — Nanjiani hosts a regular podcast on the topic, “The Indoor Kids,” with his wife, Emily Gordon. The latter provides a rich vein for some of “Silicon Valley”’s biggest blink-and-you’ll-miss-them inside jokes, unsurprisingly given that the show’s initial concept was set in the world of gaming and videogame development.

“I’ll just say that every single reference to any videogame that there is in the script, I know exactly what they’re talking about,” laughs Nanjiani. “There’s a really big Mass Effect gag that only people who’ve played through all three games will get, for instance. I mean, I’d love to say that all of my gaming and science fiction watching was just to prep for my role on this show, but no — it’s just an awesome coincidence that my personal interests and those of the character line up so perfectly.”

Nanjiani’s next project — at least until HBO officially announces it’s picking up “Silicon Valley” for another season — also plays off of his hard-earned geek cred: The Meltdown with Jonah and Kumail, a long-running comedy show he and his friend and fellow comedian Jonah Ray have been hosting at L.A.’s Meltdown Comics, has been packaged for television by Ben Stiller’s Red Hour Productions, and is slated to begin airing on Comedy Central this year.

But for now, it’s all about “SV.” The show is getting raves, not just from tech insiders, but television critics as well. Nanjiani is confident viewers will board the bandwagon — confident enough to give some hints for what lies ahead for the show, even beyond this season’s eight episodes. “The story this season is David versus Goliath — our little group is in a race against time to get our product out against this huge corporation, run by Gavin Belson,” says Nanjiani. “But what this season is really about is us coming together behind Richard, realizing that he’s the guy who needs to be at the helm. And that’s a tough thing for my character in particular, because both of us are programmers and I think I’m as good as he is, and can do what he can do. So it’s about establishing that pecking order.”

Nanjiani gets something of a comeuppance in episode six, he notes. “I don’t want to ruin too much, but it involves a woman,” he says. “How that episode unfolds really is everything my character is about in microcosm, from beginning to end. When you see what happens to me there, you’ll understand what it is that makes Dinesh so hilarious.”

And then, episode seven and eight, and a tense wait for the show to come back. “I think it will,” he says. “The first season is really a very satisfying story on its own, but we end with a really, really good setup for season two.”

God forbid it doesn’t come back. All of society’s powers-that-be eventually get the satirical takedown they deserve, from big business to the Washington Beltway to Madison Avenue — and Silicon Valley deserves its own more than anywhere right now. But if it doesn’t, at least Nanjiani’s parents have a backup option for him.

“They love everything I do, they have all of these newspaper clips pinned up in the living room,” he laughs. “But it all still doesn’t make sense to them. ‘What’s your day job?’ they keep asking. My dad even asked me recently if I was thinking of going back to med school. I think that ship has sailed, Dad.”