The HBO comedy series Silicon Valley ended its six-season long run in December 2019. While the show has had a handful of cameos comedy stars, producers got tech titan Bill Gates to appear in the finale. What was the Microsoft legend like on the set of the TV show that parodies his own industry? Series creator Mike Judge revealed the behind-the-scenes info in a recent interview. [Spoiler alert for the series finale of Silicon Valley below.]

‘Silicon Valley’ series finale provides closure for characters

The cast of Silicon Valley | FilmMagic/FilmMagic

In the Silicon Valley season 6 finale, CEO Richard Hendricks, played by actor Thomas Middleditch, hosts an event to launch the Pied Piper-AT&T partnership. But because the Pied Piper execs discover that their world-changing AI will eventually learn to decrypt any code, it’s too dangerous to release. Richard and his colleague Gilfoyle, played by Martin Starr, plan their own company’s failure and very public humiliation by replacing their original code with purposefully destructive code. After some uninformed employees switch it back to the original, another Pied Piper exec Dinesh, played by Kumail Nanjiani, climbs to the node on top of a skyscraper to reverse the code.

Lead actor Middleditch also revealed what he thought about Silicon Valley’s finale to USA Today.

“The show is equal parts about failure (and) success,” Middleditch shared. “As the characters [said], they’re going to succeed at failing. To do that to the thing you’ve dedicated your life to is the ultimate falling on one’s sword.”

The data “noise” from Pied Piper’s destructive code makes rats run wild in the city. It’s a perfectly modern nod to the legend of the Pied Piper.

How tech giant Bill Gates cast on the Season 6 finale episode

The Pied Piper disaster leads to a kind of cameo montage in the Silicon Valley finale. We see Conan O’Brien cracking monologue jokes on his late-night talk show. Then, we see Jim Cramer of Mad Money yell about the deal. In a documentary-style overview of the fictional tech company’s failure, the series finale episode has echoes of the media narrative surrounding the tech scam known as Theranos.

However, the show’s biggest name in the series finale is world-famous billionaire, Bill Gates. In the documentary-within-the-episode, Gates is puzzled by Pied Piper’s publicly embarrassing debacle.

Matt Ross | Eddy Chen/HBO

“It’s weird,” Gates says in an interview for the documentarians. “It really seemed like Pied Piper was going to work. Something doesn’t add up.”

Mike Judge, the mastermind/executive producer behind Silicon Valley, told USA Today that getting Gates was basically a pipe dream for the show. Judge says they tried to get Facebook execs Mark Zuckerberg and Sheryl Sandberg to appear on the show in earlier seasons, but it didn’t work out.

“Somebody had asked me around Season 2, ‘If you could get anybody in the show …?’ and I just threw out, ‘Bill Gates,'” Judge shared. Therefore, the Silicon Valley finale was like a dream come true.

“It was pretty amazing to have Bill Gates in it,” Judge said. “We finally got (him).” Judge also revealed that Gates was amazing to have on set.

Microsoft founder Bill Gates | LIONEL BONAVENTURE/AFP via Getty Images

The cameo, he said “worked out perfectly.” Judge even complimented Gate’s acting chops.

“He was actually a really good actor,” Judge admitted.

Will ‘Silicon Valley’ get a season 7 on HBO?

“I’d be open to it,” Silicon Valley executive producer and director Alec Berg said about getting the gang back together. “I love working with the guys.” Berg seemed to indicate that the future is wide open.

“Nobody died in the finale – well, we don’t know that for sure – but they’re all around,” he said. “So who knows?” What about the star of the show, the Pied Piper dreamer himself, Thomas Middleditch?

Thomas Middleditch, Zach Woods, Martin Starr, Kumail Nanjiani | Eddy Chen/HBO

“I’m really happy with how it ended,” the improv star said of the Silicon Valley finale in USA Today. “Series finales are tough and this one was so satisfying.” Middleditch said that his character, ever the over-anxious, screw-up, lands right where he’s meant to be.

“Where Richard ends up in a classic Silicon Valley bittersweet ending is perfect,” Middleditch said.