Despite Ms. Brehl’s friendship with Mr. Mallory, she was shocked. “I had no idea that he was writing a book,” she said. Had Mr. Mallory not prudently scheduled a weeklong trip to Palm Springs, which began the day his agent sent the manuscript to publishers, Ms. Brehl imagines she may have walked the book into his office to ask for his thoughts on it.
Mr. Mallory had always planned to submit the manuscript under a pseudonym, which is a mash-up of his cousin’s name, Alice Jane, plus the name of another family member’s French bulldog.
“I felt it would be disconcerting for my authors to wander into a bookshop and see their editor’s name writ large across a hardback,” he said.
While editors moonlighting as authors isn’t the norm, Mr. Mallory’s crossover is not entirely unique. The novelist David Ebershoff had been working as an editor at Random House two years when his first book, “The Danish Girl,” was published in 2000. Former children’s book editor Tui Sutherland has published numerous books under her own name as well as multiple pseudonyms, including Tamara Summers, Heather Williams and Rob Kidd. Other recent author/editors of note include former Simon & Schuster editor Greer Hendricks (“The Wife Between Us,” coauthored with Sarah Pekkanen), Scribner editor in chief Colin Harrison (“You Belong to Me”), former Riverhead assistant editor Danya Kukafka (“Girl in Snow”), Random House senior editor Anna Pitoniak (“The Futures”) and Henry Holt senior editor Caroline Zancan (“Local Girls”).
But none generated buzz on par with “The Woman in the Window” which, following its sale, collected blurbs from such authors as Gillian Flynn, who called it “a noir for the new millennium,” and Stephen King, who deemed it “one of those rare books that really is unputdownable.”
What impressed Mr. King most was the seamless integration of classic films such as “Vertigo,” “Rear Window” and “Gaslight.”
Mr. Mallory, who is 38, has had a near lifelong fascination with psychological thrillers that began 30 years ago, when his parents dropped him off at an art house cinema in North Carolina for the afternoon. The film playing was Dutch director and producer George Sluizer’s “The Vanishing,” which Stanley Kubrick once called “the most horrifying film I’ve ever seen.”
Mr. Mallory said he was terrified, but “I was unable to prize my eyes from the screen.” The dueling emotions “interested and sort of disturbed me even at that age.”
As a teenager, he discovered Alfred Hitchcock’s “Psycho,” which proved a gateway drug to the rest of Hitchcock’s oeuvre, along with film noir and suspense novels like Patricia Highsmith’s Tom Ripley series.
He majored in literature at Duke University, and went on to pursue a master’s and doctorate at Oxford. There, he wrote about transgressive sexuality in the works of Highsmith, Graham Greene and Henry James, whose novel “The Turn of the Screw,” with its own unreliable narrator, Mr. Mallory considers the original psychological thriller.
For several years, Mr. Mallory lived in London and worked at the commercial publishing imprint Sphere, of Little, Brown UK, before returning to New York to spearhead a crime and thriller digital first initiative at William Morrow.
While he had long considered writing fiction, it was only when he clocked the popularity of “Gone Girl” and “Girl on the Train,” two commercially successful descendants of the classic genre he’d long loved, that he realized the market was ripe for the kind of story he might want to tell. But while his publisher’s eye for a successful trend may have primed him for the idea, the novel’s premise was deeply personal.
The idea came to Mr. Mallory one night as he sat on his couch watching an old favorite, Hitchcock’s “Rear Window.” Out of the corner of his eye, he noticed a lamp switch on in the apartment across the street.
“It occurred to me, ‘Oh, how funny, in 1954 Jimmy Stewart is spying on his neighbor, and in 2015, I’m doing the same thing,’ ” he said. “Voyeurism dies hard.”
At the time, after struggling for a decade and a half with severe depression, Mr. Mallory had recently been diagnosed with bipolar II disorder, and was in his third week of almost total isolation as he transitioned from one medication to another.
“I thought, too, as I was watching the woman across the street, about how, despite living in one of the most populous cities in the world, I felt quite lonely,” he said.
Over the next two days, Mr. Mallory wrote a 7,500-word outline for a novel about a former child therapist who, trapped in her Harlem townhouse by her crippling agoraphobia, becomes obsessed with the family that moves into the building opposite her own. Once finished, Mr. Mallory sent the outline to his friend Jennifer Joel, a partner and literary agent at ICM, who encouraged him to pursue the project.
For the next 12 months, Mr. Mallory wrote on nights and weekends, telling nobody but his sister and then-boyfriend, to whom the book is dedicated. His aim throughout the process, he said, was to write a book that felt like a film, and while the plotting came to him in an easy burst, the writing proved more of a challenge.
“Getting a character from a sofa to a window is surprisingly difficult,” he said.
Mr. Mallory, who describes himself as “constitutionally cautious,” continued at William Morrow for another 15 months after the sale of his book, but his international publishers hoped to send him on a nine month world tour to promote “The Woman in the Window,” and the draft of his second novel was due to Ms. Brehl.
Five days before his book hit shelves, he had his final day at his desk job.
While Mr. Mallory now describes himself as “significantly better off financially,” he hasn’t yet found the time to make use of his recent windfall. When he finishes his book tour, he does plan to purchase a larger apartment with a dedicated writing room. And a French bulldog.
An earlier version of this article misstated the spelling of a film title. The correct title is “Gaslight,” not “Gas Light.”