Leave it to Mike Judge to satirize the tech boom and make it (mostly) work.

What Entourage did for Hollywood, the Office Space and Beavis and Butt-Head creator wants to do for tech with the HBO series Silicon Valley. But replace Los Angeles’s glitz for Palo Alto’s hyperdeveloped suburbia. And swap the smooth-talking ballers for awkward nerds hoping that their startup idea — in this case, a complex string of math that crunches huge files into smaller bits — will become the next billion-dollar company à la Facebook FB .

Silicon Valley offers a glimpse into the reality distortion bubble that is tech: the archetypes, wads of cash, and copious industry quirks. There’s a side-splitting moment during the pilot when two characters stroll through their work campus. Several nearby co-workers have mounted a giant monstrosity of a bicycle built for four and begin awkwardly pedaling away. Those familiar with Google GOOG headquarters and its ubiquitous employee bikes will appreciate the hyperbolic shtick.

“Let’s say these guys started their own company out of this house,” explains Alec Berg, the show’s executive producer, of the plot. “How would it work? What are the bumps they would encounter? What are the things they would have to account for? Where would they screw up?”

“Engineers as a breed tend to be better with things than with people,” argues Berg. “So any time you get people like that who are kind of socially dysfunctional, and you start pouring billions of dollars on top of them, that’s a very interesting, rich area for quirkiness and weirdness, which breeds comedy.”

To get Silicon Valley right, Judge — who tried his hand at engineering right after college — toured Google’s headquarters, visited the San Francisco-based mobile video startup Tout, plus two L.A. incubators, and hired a consultant. He also called upon his previous experiences during the dotcom bubble.

The show’s best jokes exploit the computer nerd stereotype to the hilt, with jokes about binary numbers and awkwardness with women.

“My prep work was years and years of being bullied. It helps to be an absolute loser growing up,” half-jokes Thomas Middleditch, who plays Richard Hendricks, a talented programmer and the show’s lead. Hendricks ditches his job at a tech giant to run PiedPiper, his startup, full-time.

Viewers can expect season one to follow PiedPiper’s struggles as an early startup, culminating in Hendricks and his motley crew pitching onstage at Disrupt, a biannual conference hosted by the tech blog TechCrunch. You can also expect what cast member Martin Starr promises will be the “most complicated dick joke in the history of comedy” during the show’s finale — a scene that took days to set up and required a team of actual physicists to troubleshoot.

“It’s very intricate, and it involves an enormous amount of calculations, mathematical simulations of sex acts, physics, and diagrams,” promises Berg, who also executive-produced Seinfeld and Curb Your Enthusiasm. The result: a comedic payoff Berg says he’s been waiting for “my whole life.”

At the Silicon Valley premiere in Redwood City, Calif., this Thursday, HBO aired the first two episodes. The second episode lacked the consistent zingers of the pilot. And while the show’s industry insider jokes went over well with last night’s star-studded crowd — Tesla TSLA founder Mark Pincus — whether Silicon Valley has broader audience appeal beyond the clued-in tech folk remains to be seen.

The show’s cast would argue it does, obviously. For one thing, Silicon Valley and Hollywood aren’t as disparate as they seem, explains T.J. Miller, who plays one of the startup’s shareholders.

“One’s dealing with zeros and ones that have some kind of ‘visual platform’ that is ‘vertically integrated’ and what ever all that means. In Hollywood, we’re ‘cross-platforming,’ trying to get a new franchise going,” Miller notes. “But in both places no one knows what’s going on, except if you hit upon something no one can describe. Then you’ll make enough money to truly be alienated, ostracized, and unhappy.”

Chimes in Middleditch: “That’s the dream, right?”

The series premiere of HBO’s Silicon Valley will air April 6 at 10 p.m. ET.