In a leafy cafe courtyard in San Francisco, Anna Wiener is cradling a cup of tea while eavesdropping on the next table. “There’s a man wearing shiny pants, holding forth on artificial intelligence and ‘the Chinese hegemon’,” she says, eyes glimmering with amusement.

It will come as no surprise to readers of her debut, Uncanny Valley, that Wiener is as quick witted in person as she appears on the page. “All writing is a sort of performance,” she says. In the book Wiener condenses five years of working at tech startups in Silicon Valley into a neat narrative about outsized male egos, dramatic wealth disparities and the psychological toll on young female employees.

Despite its unsavoury and troubling contents – unregulated surveillance technology, ruthless bosses, casual sexual harassment – the book is a delight. Deftly drawn characters are granted pseudonyms and companies are unnamed; instead they are identified by cutting descriptions. Facebook is the “social network everyone hated” and Edward Snowden is “the NSA whistleblower who was back in media”. Microsoft is the “highly litigious Seattle-based software conglomerate”. Essentially, she says: “It’s important to remember that Google is an ad platform and that Facebook is a surveillance platform.”

I envied their sense of entitlement to the future. There were no crises in their vision … only opportunities.

Wiener interviewed former colleagues and friends, engaging in what she calls “a dance around everyone else’s NDA”. She also scoured her iMessage chats and email archive for granular details, such as the humourless office flag that read “In Meritocracy We Trust”. “My Gmail is an incredible corpus of mid-20s work anxiety,” she sighs. “And an archive of what in hindsight are very obvious ways to navigate work situations that were overly complex, because I didn’t know how to be a person.”

The book first took shape in 2015 as a lightly fictionalised essay for the Brooklyn-based literary magazine n+1. Wiener’s piece went viral but the surge of attention came as a shock. “I thought that no one in literary n+1 world would care about Silicon Valley startups, and that no one in Silicon Valley reads n+1.” For years, she had documented the cultish work rituals and peculiar cultural norms of the industry, but it wasn’t until Dayna Tortorici, editor of n+1, visited San Francisco that she considered synthesising those observations into a cohesive narrative. “Dayna has a theory that people in tech aren’t used to being seen because everything is mediated,” Wiener says. “I wrote the piece to entertain her.”

As an editor, Tortorici had noticed an unnerving pattern: when writing about their workplaces, female contributors were often threatened for violating NDAs, whereas rarely, if ever were NDAs used against male writers. (Despite the industry’s fervent defences of freedom of speech, most tech companies also enforce strict policies that ensure former employees stay silent about work conditions, including sexual harassment allegations.)

While she didn’t face NDA-related constraints, Wiener’s first drafts were fairly restrained. Tortorici encouraged her to reveal more about her former bosses without worrying about reprisals. By 2018, Wiener had left her job at the software development platform GitHub after a seven-way auction to expand the original n+1 essay into a book. (And in January 2018, Universal Pictures optioned film rights; the screenplay is now in its initial development stages and Wiener is executive producer.) “I very deliberately wrote this book as non-fiction and memoir,” she says, “because if I wrote it as fiction, it could be mistaken as satire. And I don’t know how politically useful satire about the tech industry is in 2019. I want this book to be politically useful.”

Wiener, now 32, grew up in Brooklyn, New York. Her mother is a writer and gun-control activist – co-founder of the nonprofit New Yorkers Against Gun Violence – and her father a former business journalist; she was exposed to feminist ideas and progressive politics at a young age. In person, Wiener is self-possessed. Apart from bitten fingernails and frank asides about therapy there are few signs of neuroses, although she says: “I have very bad anxiety.” Her worries around the book centre on her use of creative non-fiction techniques: the story is based on real events, but the specific timeline and characters are compressed for clarity and cohesion. She is concerned about whether people in the tech industry will understand the conventions of this approach – and about possible backlash from tech executives whose public images can directly affect their companies’ stock value. “I sometimes have these daytime nightmares about testifying in court about creative non-fiction, where I’m like, ‘I would like to summon Vivian Gornick to the stand to explain compression,’ or ‘I’d like to bring in John D’Agata to discuss composite characters.’”

Silicon Valley … ‘You can practically throw a spitball and hit a badly named company.’ Photograph: yhelfman/Getty Images/iStockphoto

Just as New York City is a core character in Ben Lerner’s auto-fictitious 10:04 and various areas of California play leading roles in Joan Didion’s seminal essay collection The White Album, both influential texts for Wiener, San Francisco and its immersive digital world are central characters in Uncanny Valley. The digital landscape is textured with what is referred to as “God mode” – an employee’s unbridled access to her company’s database, from which she can intensively track users and glean their personal information. In the book, Wiener describes her workplace’s blase, apolitical attitude to God mode: “We didn’t think of ourselves as participating in the surveillance economy. We certainly weren’t thinking about our role in facilitating and normalising the creation of unregulated, privately held databases on human behaviour.” She continues: “Users might not know they were being tracked, but that was between them and our customer companies.”

While writing, Wiener studiously avoided reading books about the tech industry, and instead focused on office novels and compact memoirs, including Renata Adler’s groundbreaking novel Speedboat, which centred on a New York journalist in the 70s; and Sarah Manguso’s The Guardians, a memoir about mourning the death of a friend who escaped from a psychiatric hospital and jumped in front of a train. “I tried to reread Ellen Ullman’s Close to the Machine a little bit stoned in a hot bath – an ostensibly relaxing situation – and almost had a panic attack. It’s essentially a perfect memoir and sets the standard,” she explains. (Ullman is an engineer who documented her experience developing software at the forefront of the male-dominated technology boom in the 90s.)

For a moment, Wiener is distracted by the cafe’s playlist as Nirvana thunder over the speakers. “I feel like I’m 16 and burning incense in my bedroom and telling my mom I’m a vegetarian,” she deadpans.

We return to unpacking Silicon Valley’s accountability problem and popular modes of aggrandisement. “The way that people spoke in San Francisco was so strange to me, like all of the acronyms, jargon and weird things that people do to the English language. To inspire us in a meeting, one CEO said, ‘We’re at war!’ And like, ‘Learnings.’ Why? It’s ‘lesson’,” she says. “I find the naming scheme of the last 15 years in tech companies to be very funny, these names are just obscene.” She rattles off AppLovin and Verbling as two of her favourites. “You can practically throw a spitball and hit a badly named company.”

Throughout the memoir, there are moments when Wiener acquiesces to male characters’ demands only to correct her course with a renewed sense of agency. In a memorable scene, she goes out to a Japanese bar with her mostly male co-workers to celebrate their boss’s birthday, conceiving of herself as the “babysitter, fifth wheel, chaperone, little sister, ball and chain, and concubine”. She explains: “I was always trying to be someone’s girlfriend, sister or mother.” (Uncanny Valley takes place in the years leading up to the #MeToo movement; details about a sexual assault incident were withheld from the book to protect her former colleague’s anonymity.)

The 2016 election result strikes at the end of the book with cataclysmic force, no doubt a reflection of the way the author herself experienced the event. “The major failure of the media in the years leading up to the election was to not take tech companies and their ambitions very seriously,” Wiener says. “The media engaged with the industry on the industry’s terms. It lapped up the mythology.”

In reference to the founders of an ebook startup, Wiener’s first tech job, she writes: “I envied their sense of entitlement to the future. There were no crises in their vision … only opportunities.” In California, this techno-optimist outlook is often associated with anti-union, libertarian politics. By contrast, she says: “I’ve always had a hard time picturing a future, which one could credit to having witnessed a major terrorist attack as a teenager.” She pauses. “In my head I was like, don’t mention 9/11.” She continues: “My hope for the future is that we start to move slower and at a smaller scale.”

At the end of Uncanny Valley, after the 2016 election, Wiener writes that she felt that the industry “was in for a reckoning, that it was the beginning of the end, that what [she] had experienced in San Francisco was the final stage of a prelapsarian era, the end of our generational gold rush, an unsustainable age of excess.” A freewheeling culture of misinformation, offensive memes and trolling – unfettered by regulation or oversight – only proliferated. Wiener says: “The city and the industry, bound by the ecosystem, continued to cycle and churn.”

Of course, conflicting views of the future also reflect a greater schism in industry. Just as the publishing world shrinks, tech companies bloat with capital. “If we continue on the track that we’re on, we’re going to move into an era of even greater privatisation,” Wiener says, shifting uncomfortably in her chair. “The future will be increasingly homogeneous, divisive and private.” To illustrate this point she highlights public goods or services that are increasingly privatised, like for-profit coding boot camps, which are marketed as an investment or a substitute for a four-year university degree. “The tech industry is trying to provide solutions to crises that they didn’t necessarily create, but that they are now exacerbating.

“Everyone deserves better. Especially employees and consumers. But I don’t know that change is going to come from within the industry because the incentives of venture capital encourage speed and rapid growth, which inspire a certain thoughtlessness – or recklessness.” She pauses. “There is currently very little accountability.”

• Uncanny Valley: A Memoir is published by HarperCollins (RRP £16.99). To order a copy go to guardianbookshop.com. Free UK p&p over £15.